Package org.nuiton.topia.persistence
Class DepthEntityVisitor
java.lang.Object
org.nuiton.topia.persistence.DepthEntityVisitor
- All Implemented Interfaces:
TopiaEntityVisitor
- Direct Known Subclasses:
Collector.CollectorVisitor
Visitor to run through the entity graph by depth.
- Author:
- Éric Chatellier - chatellier@codelutin.com, Tony Chemit - tchemit@codelutin.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Collection<TopiaEntity>Cache of already explored entities.protected TopiaEntityVisitorThe business visitor (optional) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Reset all states of the visitor.voidend(TopiaEntity e) Ends the visit of the given entity.voidstart(TopiaEntity e) Start the visit of the given entity.voidvisit(TopiaEntity e, String propertyName, Class<?> collectionType, Class<?> type, int index, Object value) Visit a indexed value from a collection property for the given entity.voidVisit a collection property for the given entity.voidvisit(TopiaEntity e, String propertyName, Class<?> type, Object value) Visit a none indexed property for the given entity.
-
Field Details
-
alreadyExplored
Cache of already explored entities. -
delegateVisitor
The business visitor (optional)
-
-
Constructor Details
-
DepthEntityVisitor
public DepthEntityVisitor() -
DepthEntityVisitor
-
-
Method Details
-
start
Description copied from interface:TopiaEntityVisitorStart the visit of the given entity.- Specified by:
startin interfaceTopiaEntityVisitor- Parameters:
e- the visited entity
-
visit
Description copied from interface:TopiaEntityVisitorVisit a none indexed property for the given entity. The property visited is defined by the other parameters.- Specified by:
visitin interfaceTopiaEntityVisitor- Parameters:
e- the visited entitypropertyName- the name of the visited propertytype- the type of the visited propertyvalue- the value of the visited property
-
visit
public void visit(TopiaEntity e, String propertyName, Class<?> collectionType, Class<?> type, Object value) Description copied from interface:TopiaEntityVisitorVisit a collection property for the given entity. The property visited is defined by the other parameters.- Specified by:
visitin interfaceTopiaEntityVisitor- Parameters:
e- the visited entitypropertyName- the name of the visited propertycollectionType- the type of the visited collectiontype- the type of the visited propertyvalue- the value of the visited property
-
visit
public void visit(TopiaEntity e, String propertyName, Class<?> collectionType, Class<?> type, int index, Object value) Description copied from interface:TopiaEntityVisitorVisit a indexed value from a collection property for the given entity. The property visited is defined by the other parameters.- Specified by:
visitin interfaceTopiaEntityVisitor- Parameters:
e- the visited entitypropertyName- the name of the visited propertycollectionType- the type of the container of the visited propertytype- the type of the visited propertyindex- the index of the visited property in his containervalue- the value of the visited property
-
end
Description copied from interface:TopiaEntityVisitorEnds the visit of the given entity.- Specified by:
endin interfaceTopiaEntityVisitor- Parameters:
e- the visited entity
-
clear
public void clear()Description copied from interface:TopiaEntityVisitorReset all states of the visitor. If you use internal states inside the visitor, this method should clean all of them. This method should be invoked after usage of the visitor.- Specified by:
clearin interfaceTopiaEntityVisitor
-