Package org.nuiton.topia.persistence
Class HorizontalEntityVisitor
java.lang.Object
org.nuiton.topia.persistence.HorizontalEntityVisitor
- All Implemented Interfaces:
EntityVisitor
Parcourt en largeur du modele et délegation à un autre visiteur.
- Version:
- $Id$
- Author:
- echatellier <chatellier@codelutin.com>, tchemit <tchemit@codelutin.com>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<TopiaEntity>Cache used to remember entity during exploration.protected EntityVisitorDelegate visitor.protected List<TopiaEntity>Entity to be visited later. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Reset all states of the visitor.voidend(TopiaEntity entity) Ends the visit of the given entity.voidstart(TopiaEntity entity) Start the visit of the given entity.voidvisit(TopiaEntity entity, String propertyName, Class<?> collectionType, Class<?> type, int index, Object value) Visit a indexed value from a collection property for the given entity.voidvisit(TopiaEntity entity, String propertyName, Class<?> collectionType, Class<?> type, Object value) Visit a collection property for the given entity.voidvisit(TopiaEntity entity, String propertyName, Class<?> type, Object value) Visit a none indexed property for the given entity.
-
Field Details
-
delegateVisitor
Delegate visitor. -
alreadyExplored
Cache used to remember entity during exploration. -
toVisitEntities
Entity to be visited later.
-
-
Constructor Details
-
HorizontalEntityVisitor
Constructor.- Parameters:
delegateVisitor- delegate visitor
-
-
Method Details
-
start
Description copied from interface:EntityVisitorStart the visit of the given entity.- Specified by:
startin interfaceEntityVisitor- Parameters:
entity- the visited entity
-
visit
Description copied from interface:EntityVisitorVisit a none indexed property for the given entity. The property visited is defined by the other parameters.- Specified by:
visitin interfaceEntityVisitor- Parameters:
entity- 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 entity, String propertyName, Class<?> collectionType, Class<?> type, Object value) Description copied from interface:EntityVisitorVisit a collection property for the given entity. The property visited is defined by the other parameters.- Specified by:
visitin interfaceEntityVisitor- Parameters:
entity- 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 entity, String propertyName, Class<?> collectionType, Class<?> type, int index, Object value) Description copied from interface:EntityVisitorVisit a indexed value from a collection property for the given entity. The property visited is defined by the other parameters.- Specified by:
visitin interfaceEntityVisitor- Parameters:
entity- 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:EntityVisitorEnds the visit of the given entity.- Specified by:
endin interfaceEntityVisitor- Parameters:
entity- the visited entity
-
clear
public void clear()Description copied from interface:EntityVisitorReset 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 interfaceEntityVisitor
-