org.cip4.jdflib.elementwalker
Class BaseWalker

java.lang.Object
  extended by org.cip4.jdflib.elementwalker.BaseWalker
All Implemented Interfaces:
Comparable<BaseWalker>, IWalker
Direct Known Subclasses:
AttributeReplacer.WalkDefault, EnsureElementUri.WalkElement, EnsureNSUri.WalkElement, FixVersion.WalkElement, IDFinder.WalkResource, IDFinder.WalkSet, LinkRefFinder.WalkRef, RemoveEmpty.WalkElement, RemovePrivate.WalkElement, ResourceIDFinder.WalkStop, SizeWalker.WalkElement, UnLinkFinder.WalkRef, UnLinkFinder.WalkRes, URLExtractor.WalkElement, URLMapper.WalkElement, XJDF20.WalkElement, XJDFSchemaCreator.WalkElement, XJDFSchemaWalker.WalkElement, XJDFToJDFConverter.WalkXElement, XPathWalker.WalkAll

public class BaseWalker
extends Object
implements IWalker, Comparable<BaseWalker>

Author:
Rainer Prosi, Heidelberger Druckmaschinen

Field Summary
protected  int depth
           
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
BaseWalker(BaseWalkerFactory factory)
           
 
Method Summary
 int compareTo(BaseWalker arg0)
          note the reverse order - high depth means up in list so that abstract classes get checked later (non-Javadoc)
 void finalizeWalk(KElement e, KElement trackElem)
          hook for guaranteed postwalk finalization
 int getDepth()
           
 boolean matches(KElement e)
          this is the check whether or not to use this walker for a given element should be overwritten
 void prepareWalk(KElement e, KElement trackElem)
          hook for guaranteed prewalk initialization
 String toString()
           
 KElement walk(KElement e, KElement trackElem)
          the mother routine for walking....
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

depth

protected int depth

log

protected final org.apache.commons.logging.Log log
Constructor Detail

BaseWalker

public BaseWalker(BaseWalkerFactory factory)
Parameters:
factory -
Method Detail

walk

public KElement walk(KElement e,
                     KElement trackElem)
the mother routine for walking....

Specified by:
walk in interface IWalker
Parameters:
e - the element to walk
trackElem - 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:
prepareWalk in interface IWalker
Parameters:
e -
trackElem -

finalizeWalk

public void finalizeWalk(KElement e,
                         KElement trackElem)
hook for guaranteed postwalk finalization

Specified by:
finalizeWalk in interface IWalker
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

compareTo

public int compareTo(BaseWalker arg0)
note the reverse order - high depth means up in list so that abstract classes get checked later (non-Javadoc)

Specified by:
compareTo in interface Comparable<BaseWalker>
Parameters:
arg0 - the other Basewalker
Returns:
int
See Also:
Comparable.compareTo(java.lang.Object)

toString

public String toString()
Overrides:
toString in class Object
Returns:
the string
See Also:
Object.toString()


Copyright © 2013. All Rights Reserved.