org.nuiton.topia.persistence
Class HorizontalEntityVisitor

java.lang.Object
  extended by org.nuiton.topia.persistence.HorizontalEntityVisitor
All Implemented Interfaces:
EntityVisitor

public class HorizontalEntityVisitor
extends Object
implements EntityVisitor

Parcourt en largeur du modele et délegation à un autre visiteur.

Version:
$Id: HorizontalEntityVisitor.java 2245 2011-04-14 12:47:09Z tchemit $
Author:
chatellier , tchemit

Field Summary
protected  List<TopiaEntity> alreadyExplored
          Cache used to remember entity during exploration.
protected  EntityVisitor delegateVisitor
          Delegate visitor.
protected  List<TopiaEntity> toVisitEntities
          Entity to be visited later.
 
Constructor Summary
HorizontalEntityVisitor(EntityVisitor delegateVisitor)
          Constructor.
 
Method Summary
 void clear()
          Reset all states of the visitor.
 void end(TopiaEntity entity)
          Ends the visit of the given entity.
 void start(TopiaEntity entity)
          Start the visit of the given entity.
 void visit(TopiaEntity entity, String propertyName, Class<?> collectionType, Class<?> type, int index, Object value)
          Visit a indexed value from a collection property for the given entity.
 void visit(TopiaEntity entity, String propertyName, Class<?> collectionType, Class<?> type, Object value)
          Visit a collection property for the given entity.
 void visit(TopiaEntity entity, String propertyName, Class<?> type, Object value)
          Visit a none indexed property for the given entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegateVisitor

protected EntityVisitor delegateVisitor
Delegate visitor.


alreadyExplored

protected List<TopiaEntity> alreadyExplored
Cache used to remember entity during exploration.


toVisitEntities

protected List<TopiaEntity> toVisitEntities
Entity to be visited later.

Constructor Detail

HorizontalEntityVisitor

public HorizontalEntityVisitor(EntityVisitor delegateVisitor)
Constructor.

Parameters:
delegateVisitor - delegate visitor
Method Detail

start

public void start(TopiaEntity entity)
Description copied from interface: EntityVisitor
Start the visit of the given entity.

Specified by:
start in interface EntityVisitor
Parameters:
entity - the visited entity

visit

public void visit(TopiaEntity entity,
                  String propertyName,
                  Class<?> type,
                  Object value)
Description copied from interface: EntityVisitor
Visit a none indexed property for the given entity. The property visited is defined by the other parameters.

Specified by:
visit in interface EntityVisitor
Parameters:
entity - the visited entity
propertyName - the name of the visited property
type - the type of the visited property
value - the value of the visited property

visit

public void visit(TopiaEntity entity,
                  String propertyName,
                  Class<?> collectionType,
                  Class<?> type,
                  Object value)
Description copied from interface: EntityVisitor
Visit a collection property for the given entity. The property visited is defined by the other parameters.

Specified by:
visit in interface EntityVisitor
Parameters:
entity - the visited entity
propertyName - the name of the visited property
collectionType - the type of the visited collection
type - the type of the visited property
value - 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: EntityVisitor
Visit a indexed value from a collection property for the given entity. The property visited is defined by the other parameters.

Specified by:
visit in interface EntityVisitor
Parameters:
entity - the visited entity
propertyName - the name of the visited property
collectionType - the type of the container of the visited property
type - the type of the visited property
index - the index of the visited property in his container
value - the value of the visited property

end

public void end(TopiaEntity entity)
Description copied from interface: EntityVisitor
Ends the visit of the given entity.

Specified by:
end in interface EntityVisitor
Parameters:
entity - the visited entity

clear

public void clear()
Description copied from interface: EntityVisitor
Reset all states of the visitor. TODO-chatellier-20091221 : need explanations : called by who ? what is it for ?

Specified by:
clear in interface EntityVisitor


Copyright © 2004-2011 CodeLutin. All Rights Reserved.