Package org.docx4j

Class TraversalUtil.CallbackImpl

java.lang.Object
org.docx4j.TraversalUtil.CallbackImpl
All Implemented Interfaces:
TraversalUtil.Callback
Direct Known Subclasses:
AbstractTraversalUtilVisitorCallback, AbstractVisitorExporterGenerator, AltChunkFinder, ClassFinder, CommentFinder, ComplexFieldLocator, ConversionSectionWrapperFactory.SdtBlockFinder, ParagraphStylesInTableFix.StyleRenamer, RangeFinder, SdtFinder, SectPrFinder, SectPrFindFirst, SimpleFieldLocator, TableFinder, TableModel.TrFinder, TcFinder, TocFinder
Enclosing class:
TraversalUtil

public abstract static class TraversalUtil.CallbackImpl
extends java.lang.Object
implements TraversalUtil.Callback
  • Constructor Summary

    Constructors
    Constructor Description
    CallbackImpl()  
  • Method Summary

    Modifier and Type Method Description
    abstract java.util.List<java.lang.Object> apply​(java.lang.Object o)
    Visits a node in pre order (before its children have been visited).
    java.util.List<java.lang.Object> getChildren​(java.lang.Object o)  
    boolean shouldTraverse​(java.lang.Object o)
    Decide whether this node's children should be traversed.
    void walkJAXBElements​(java.lang.Object parent)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CallbackImpl

      public CallbackImpl()
  • Method Details

    • walkJAXBElements

      public void walkJAXBElements​(java.lang.Object parent)
      Specified by:
      walkJAXBElements in interface TraversalUtil.Callback
    • getChildren

      public java.util.List<java.lang.Object> getChildren​(java.lang.Object o)
      Specified by:
      getChildren in interface TraversalUtil.Callback
    • apply

      public abstract java.util.List<java.lang.Object> apply​(java.lang.Object o)
      Visits a node in pre order (before its children have been visited). A node is visited only if all its parents have been traversed ( shouldTraverse(Object)).

      Implementations can have side effects.

      Specified by:
      apply in interface TraversalUtil.Callback
    • shouldTraverse

      public boolean shouldTraverse​(java.lang.Object o)
      Decide whether this node's children should be traversed.
      Specified by:
      shouldTraverse in interface TraversalUtil.Callback
      Returns:
      whether the children of this node should be visited