Package org.cip4.jdflib.elementwalker
Class BaseWalker
- java.lang.Object
-
- org.cip4.jdflib.elementwalker.BaseWalker
-
- All Implemented Interfaces:
java.lang.Comparable<BaseWalker>,IWalker
- Direct Known Subclasses:
AttributeReplacer.WalkDefault,CapabilitiesCreator.WalkElement,EnsureElementUri.WalkElement,EnsureNSUri.WalkElement,IDFinder.WalkResource,IDFinder.WalkSet,IDRemover.WalkIgnore,IDRemover.WalkResource,LinkRefFinder.WalkRef,RemoveCompare.WalkElement,RemoveEmpty.WalkElement,RemovePrivate.WalkElement,ResourceIDFinder.WalkStop,SizeWalker.WalkElement,UnLinkFinder.WalkRef,UnLinkFinder.WalkRes,URLExtractor.WalkElement,URLMapper.WalkElement,WalkAnyElement,WalkElement,WalkXElement,XJDFSchemaCreator.WalkElement,XJDFSchemaWalker.WalkElement,XMLCompareWalker.WalkAll,XPathWalker.WalkAll
public class BaseWalker extends java.lang.Object implements IWalker, java.lang.Comparable<BaseWalker>
-
-
Constructor Summary
Constructors Constructor Description BaseWalker()BaseWalker(BaseWalkerFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(BaseWalker arg0)note the reverse order - high depth means up in list so that abstract classes get checked latervoidfinalizeWalk(KElement e, KElement trackElem)hook for guaranteed postwalk finalizationintgetDepth()VStringgetElementNames()retur the list of elements that will always be procesed by this walkerbooleanmatches(KElement e)this is the check whether or not to use this walker for a given element should be overwrittenvoidprepareWalk(KElement e, KElement trackElem)hook for guaranteed prewalk initializationjava.lang.StringtoString()KElementwalk(KElement e, KElement trackElem)the mother routine for walking....
-
-
-
Constructor Detail
-
BaseWalker
public BaseWalker()
- Parameters:
factory-
-
BaseWalker
public BaseWalker(BaseWalkerFactory factory)
- Parameters:
factory-
-
-
Method Detail
-
walk
public KElement walk(KElement e, KElement trackElem)
the mother routine for walking....- Specified by:
walkin interfaceIWalker- Parameters:
e- the element to walktrackElem- a parallel element to e that may additionally be modified during the walk- Returns:
- !=null if this element remains after walking,
null if it was deleted and therefore the walker should skip this and all its descendants
the element may either be trackElem or a converted element to continue with as trackElem - See Also:
IWalker.walk(KElement, KElement)
-
prepareWalk
public void prepareWalk(KElement e, KElement trackElem)
hook for guaranteed prewalk initialization- Specified by:
prepareWalkin interfaceIWalker- Parameters:
e-trackElem-
-
finalizeWalk
public void finalizeWalk(KElement e, KElement trackElem)
hook for guaranteed postwalk finalization- Specified by:
finalizeWalkin interfaceIWalker- Parameters:
e-trackElem-
-
matches
public boolean matches(KElement e)
this is the check whether or not to use this walker for a given element should be overwritten- Parameters:
e- the element to check- Returns:
- true if matches - must be true for base
-
getDepth
public int getDepth()
- Returns:
- the class hierarchy depth
-
getElementNames
public VString getElementNames()
retur the list of elements that will always be procesed by this walker- Returns:
-
compareTo
public int compareTo(BaseWalker arg0)
note the reverse order - high depth means up in list so that abstract classes get checked later- Specified by:
compareToin interfacejava.lang.Comparable<BaseWalker>- Parameters:
arg0- the other Basewalker- Returns:
- int
- See Also:
Comparable.compareTo(java.lang.Object)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- the string
- See Also:
Object.toString()
-
-