| java.lang.Object javax.jcr.util.TraversingItemVisitor
TraversingItemVisitor | abstract public class TraversingItemVisitor implements ItemVisitor(Code) | | An implementation of ItemVisitor .
TraversingItemVisitor is an abstract utility class
which allows to easily traverse an Item hierarchy.
TraversingItemVisitor makes use of the Visitor Pattern
as described in the book 'Design Patterns' by the Gang Of Four
(Gamma et al.).
Tree traversal is done observing the left-to-right order of
child Item s if such an order is supported and exists.
|
Method Summary | |
abstract protected void | entering(Property property, int level) Implement this method to add behaviour performed before a
Property is visited. | abstract protected void | entering(Node node, int level) Implement this method to add behaviour performed before a
Node is visited. | abstract protected void | leaving(Property property, int level) Implement this method to add behaviour performed after a
Property is visited. | abstract protected void | leaving(Node node, int level) Implement this method to add behaviour performed after a
Node is visited. | public void | visit(Property property) Called when the Visitor is passed to a Property .
It calls TraversingItemVisitor.entering(Property, int) followed by
TraversingItemVisitor.leaving(Property, int) . | public void | visit(Node node) Called when the Visitor is passed to a Node .
It calls TraversingItemVisitor.entering(Node, int) followed by
TraversingItemVisitor.leaving(Node, int) . |
breadthFirst | final protected boolean breadthFirst(Code) | | indicates if traversal should be done in a breadth-first
manner rather than depth-first (which is the default)
|
maxLevel | final protected int maxLevel(Code) | | the 0-based level up to which the hierarchy should be traversed
(if it's -1, the hierarchy will be traversed until there are no
more children of the current item)
|
TraversingItemVisitor | public TraversingItemVisitor()(Code) | | Constructs a new instance of this class.
The tree of Item s will be traversed in a
depth-first manner (default behaviour).
|
TraversingItemVisitor | public TraversingItemVisitor(boolean breadthFirst)(Code) | | Constructs a new instance of this class.
Parameters: breadthFirst - if breadthFirst is true then traversalis done in a breadth-first manner; otherwise it is done in adepth-first manner (which is the default behaviour). |
TraversingItemVisitor | public TraversingItemVisitor(boolean breadthFirst, int maxLevel)(Code) | | Constructs a new instance of this class.
Parameters: breadthFirst - if breadthFirst is true then traversalis done in a breadth-first manner; otherwise it isdone in a depth-first manner (which is the defaultbehaviour). Parameters: maxLevel - the 0-based level up to which the hierarchy should betraversed (if it's -1, the hierarchy will be traverseduntil there are no more children of the current item) |
entering | abstract protected void entering(Property property, int level) throws RepositoryException(Code) | | Implement this method to add behaviour performed before a
Property is visited.
Parameters: property - the Property that is accepting this visitor. Parameters: level - hierarchy level of this property (the root node starts at level 0) throws: RepositoryException - if an error occurrs |
entering | abstract protected void entering(Node node, int level) throws RepositoryException(Code) | | Implement this method to add behaviour performed before a
Node is visited.
Parameters: node - the Node that is accepting this visitor. Parameters: level - hierarchy level of this node (the root node starts at level 0) throws: RepositoryException - if an error occurrs |
leaving | abstract protected void leaving(Property property, int level) throws RepositoryException(Code) | | Implement this method to add behaviour performed after a
Property is visited.
Parameters: property - the Property that is accepting this visitor. Parameters: level - hierarchy level of this property (the root node starts at level 0) throws: RepositoryException - if an error occurrs |
leaving | abstract protected void leaving(Node node, int level) throws RepositoryException(Code) | | Implement this method to add behaviour performed after a
Node is visited.
Parameters: node - the Node that is accepting this visitor. Parameters: level - hierarchy level of this node (the root node starts at level 0) throws: RepositoryException - if an error occurrs |
visit | public void visit(Property property) throws RepositoryException(Code) | | Called when the Visitor is passed to a Property .
It calls TraversingItemVisitor.entering(Property, int) followed by
TraversingItemVisitor.leaving(Property, int) . Implement these abstract methods to
specify behaviour on 'arrival at' and 'after leaving' the Property .
If this method throws, the visiting process is aborted.
Parameters: property - the Property that is accepting this visitor. throws: RepositoryException - if an error occurrs |
visit | public void visit(Node node) throws RepositoryException(Code) | | Called when the Visitor is passed to a Node .
It calls TraversingItemVisitor.entering(Node, int) followed by
TraversingItemVisitor.leaving(Node, int) . Implement these abstract methods to
specify behaviour on 'arrival at' and 'after leaving' the Node .
If this method throws, the visiting process is aborted.
Parameters: node - the Node that is accepting this visitor. throws: RepositoryException - if an error occurrs |
|
|