wt.graph
Class ObjectGraphCallback

java.lang.Object
  extended bywt.visitor.CompositeVisitor
      extended bywt.graph.ObjectGraphCallback
All Implemented Interfaces:
Serializable, Visitor
Direct Known Subclasses:
ApplicationProcessingModeVisitor, PreliminaryProcessingVisitor, PreviewProcessingModeVisitor

public class ObjectGraphCallback
extends CompositeVisitor
implements Serializable

Performs common pre/post-processing activities on each visited node as a callback. This could also be a customization point where application callbacks (visitors) are added to help satisfy a particular consumer's specific requirements.

For instance, if an application had additional requirements to censor information in the object graph, based on say specific access control permissions, then the application could add their custom visitor to the object graph's set visitor. Then when the object graph was next traversed, not only would all of the previously added visitors be employed, but additionally the newly added application visitor as well.



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static String RESOURCE
           
 
Fields inherited from class wt.visitor.CompositeVisitor
 
Constructor Summary
ObjectGraphCallback()
           
 
Method Summary
 boolean visit(Persistable fromNode, Link link, Persistable toNode, int level, boolean previouslyVisited)
          Visit a node.
 boolean visitLevel(Persistable fromNode, Vector links, Vector toNodes, int level)
          Vist nodes at this level.
 boolean visitLevel(Vector fromNodes, Vector links, Vector toNodes, int level)
          Vist nodes at this level.
 
Methods inherited from class wt.visitor.CompositeVisitor
addVisitor, getVisitors, removeVisitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME
Constructor Detail

ObjectGraphCallback

public ObjectGraphCallback()
Method Detail

visit

public boolean visit(Persistable fromNode,
                     Link link,
                     Persistable toNode,
                     int level,
                     boolean previouslyVisited)
              throws WTException
Visit a node. If false is returned, then the node will not be traversed.

Supported API: true

Specified by:
visit in interface Visitor
Overrides:
visit in class CompositeVisitor
Parameters:
fromNode -
link -
toNode -
level -
previouslyVisited -
Returns:
boolean
Throws:
WTException

visitLevel

public boolean visitLevel(Persistable fromNode,
                          Vector links,
                          Vector toNodes,
                          int level)
                   throws WTException
Vist nodes at this level. If false is returned, then none of the nodes on this level will be traversed.

Supported API: true

Specified by:
visitLevel in interface Visitor
Overrides:
visitLevel in class CompositeVisitor
Parameters:
fromNode -
links -
toNodes -
level -
Returns:
boolean
Throws:
WTException

visitLevel

public boolean visitLevel(Vector fromNodes,
                          Vector links,
                          Vector toNodes,
                          int level)
                   throws WTException
Vist nodes at this level. If false is returned, then none of the nodes on this level will be traversed.

Supported API: true

Specified by:
visitLevel in interface Visitor
Overrides:
visitLevel in class CompositeVisitor
Parameters:
fromNodes -
links -
toNodes -
level -
Returns:
boolean
Throws:
WTException