Class BaseWalker

java.lang.Object
org.cip4.jdflib.elementwalker.BaseWalker
All Implemented Interfaces:
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 Object implements IWalker, Comparable<BaseWalker>
  • Field Details

    • depth

      protected int depth
    • log

      protected final org.apache.commons.logging.Log log
  • Constructor Details

    • BaseWalker

      public BaseWalker()
      Parameters:
      factory -
    • BaseWalker

      public BaseWalker(BaseWalkerFactory factory)
      Parameters:
      factory -
  • Method Details

    • 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:
    • 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
    • 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:
      compareTo in interface Comparable<BaseWalker>
      Parameters:
      arg0 - the other Basewalker
      Returns:
      int
      See Also:
    • toString

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