Class DepthEntityVisitor

java.lang.Object
org.nuiton.topia.persistence.DepthEntityVisitor
All Implemented Interfaces:
EntityVisitor
Direct Known Subclasses:
Collector.CollectorVisitor

public class DepthEntityVisitor
extends java.lang.Object
implements EntityVisitor
Parcourt du graphe d'entité en profondeur.
Version:
$Id$
Author:
echatellier <chatellier@codelutin.com>, tchemit <tchemit@codelutin.com>
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.Collection<TopiaEntity> alreadyExplored
    Cache of already explored entities.
    protected EntityVisitor delegateVisitor
    Le visiteur metier (optionel).
  • Constructor Summary

    Constructors 
    Constructor Description
    DepthEntityVisitor()  
    DepthEntityVisitor​(EntityVisitor delegateVisitor)  
  • Method Summary

    Modifier and Type Method Description
    void clear()
    Reset all states of the visitor.
    void end​(TopiaEntity e)
    Ends the visit of the given entity.
    void start​(TopiaEntity e)
    Start the visit of the given entity.
    void visit​(TopiaEntity e, java.lang.String propertyName, java.lang.Class<?> collectionType, java.lang.Class<?> type, int index, java.lang.Object value)
    Visit a indexed value from a collection property for the given entity.
    void visit​(TopiaEntity e, java.lang.String propertyName, java.lang.Class<?> collectionType, java.lang.Class<?> type, java.lang.Object value)
    Visit a collection property for the given entity.
    void visit​(TopiaEntity e, java.lang.String propertyName, java.lang.Class<?> type, java.lang.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 Details

  • Constructor Details

  • Method Details

    • start

      public void start​(TopiaEntity e)
      Description copied from interface: EntityVisitor
      Start the visit of the given entity.
      Specified by:
      start in interface EntityVisitor
      Parameters:
      e - the visited entity
    • visit

      public void visit​(TopiaEntity e, java.lang.String propertyName, java.lang.Class<?> type, java.lang.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:
      e - 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 e, java.lang.String propertyName, java.lang.Class<?> collectionType, java.lang.Class<?> type, java.lang.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:
      e - 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 e, java.lang.String propertyName, java.lang.Class<?> collectionType, java.lang.Class<?> type, int index, java.lang.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:
      e - 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 e)
      Description copied from interface: EntityVisitor
      Ends the visit of the given entity.
      Specified by:
      end in interface EntityVisitor
      Parameters:
      e - the visited entity
    • clear

      public void clear()
      Description copied from interface: EntityVisitor
      Reset 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:
      clear in interface EntityVisitor