Package org.cip4.jdflib.elementwalker
Class ElementWalker
- java.lang.Object
-
- org.cip4.jdflib.elementwalker.ElementWalker
-
- Direct Known Subclasses:
BaseElementWalker,PackageElementWalker
public class ElementWalker extends java.lang.Objectelementwalker class that allows you to traverse a dom tree starting at a given root
-
-
Field Summary
Fields Modifier and Type Field Description protected IWalkerFactorytheFactory
-
Constructor Summary
Constructors Constructor Description ElementWalker(IWalkerFactory _theFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IWalkerFactorygetFactory()Getter for theFactory attribute.java.lang.StringtoString()intwalkTree(KElement e, KElement trackElem)walk the tree starting at e.intwalkTreeKidsFirst(KElement e)walk the tree starting at e.
-
-
-
Field Detail
-
theFactory
protected final IWalkerFactory theFactory
-
-
Constructor Detail
-
ElementWalker
public ElementWalker(IWalkerFactory _theFactory)
- Parameters:
_theFactory- used to find the individual instances for the children
-
-
Method Detail
-
walkTree
public int walkTree(KElement e, KElement trackElem)
walk the tree starting at e.- Parameters:
e- the root element to walk, must not be nulltrackElem- a parallel element to e that may additionally be modified during the walk, may be null- Returns:
- n the number of traversed elements
-
walkTreeKidsFirst
public int walkTreeKidsFirst(KElement e)
walk the tree starting at e.- Parameters:
e- the root element to walk- Returns:
- n the number of traversed elements
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
getFactory
public IWalkerFactory getFactory()
Getter for theFactory attribute.- Returns:
- the theFactory
-
-