Class AbstractVisitorExporterGenerator<CC extends AbstractWmlConversionContext>

java.lang.Object
org.docx4j.TraversalUtil.CallbackImpl
org.docx4j.convert.out.common.AbstractVisitorExporterGenerator<CC>
All Implemented Interfaces:
TraversalUtil.Callback
Direct Known Subclasses:
HTMLExporterVisitorGenerator

public abstract class AbstractVisitorExporterGenerator<CC extends AbstractWmlConversionContext>
extends TraversalUtil.CallbackImpl
The …ExporterGenerator is the visitor, that gets used in those cases where a document is done as a NonXSLT. (docx4j supports convert.out via both xslt and non-xslt based approaches)
Since:
3.0
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected java.lang.Object anchorOrInline  
    protected CC conversionContext  
    protected org.w3c.dom.Element currentP  
    protected org.w3c.dom.Element currentSpan  
    protected org.w3c.dom.Document document  
    protected static int IMAGE_E10  
    protected static int IMAGE_E20  
    protected static int NODE_BLOCK  
    protected static int NODE_INLINE  
    protected org.w3c.dom.Node parentNode  
    protected PPr pPr  
    protected RPr rPr  
    protected static java.lang.String TAB_DUMMY  
    protected java.util.LinkedList<org.w3c.dom.Element> tc  
    protected java.util.LinkedList<org.w3c.dom.Element> tr  
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected AbstractVisitorExporterGenerator​(CC conversionContext, org.w3c.dom.Document document, org.w3c.dom.Node parentNode)  
  • Method Summary

    Modifier and Type Method Description
    java.util.List<java.lang.Object> apply​(java.lang.Object o)
    Visits a node in pre order (before its children have been visited).
    protected void convertTabToNode​(CC conversionContext, org.w3c.dom.Document document)  
    protected void convertToNode​(CC conversionContext, java.lang.Object unmarshalledNode, java.lang.String modelId, org.w3c.dom.Document document, org.w3c.dom.Node parentNode)  
    protected abstract org.w3c.dom.DocumentFragment createImage​(int imgType, CC conversionContext, java.lang.Object anchorOrInline)  
    protected abstract org.w3c.dom.Element createNode​(org.w3c.dom.Document doc, int nodeType)  
    protected org.w3c.dom.Node getCurrentParent()  
    protected abstract AbstractVisitorExporterDelegate.AbstractVisitorExporterGeneratorFactory<CC> getFactory()  
    protected org.slf4j.Logger getLog()  
    protected int getPos​(java.util.List list, java.lang.Object wanted)  
    protected abstract void handleBr​(Br o)  
    protected abstract org.w3c.dom.Element handlePPr​(CC conversionContext, PPr pPrDirect, boolean sdt, org.w3c.dom.Element currentParent)  
    protected abstract void handleRPr​(CC conversionContext, PPr pPrDirect, RPr rPrDirect, org.w3c.dom.Element currentParent)
    On a block representing a run, we just put run properties from this rPr node.
    protected void rtlAwareAppendChildToCurrentP​(org.w3c.dom.Element child)  
    boolean shouldTraverse​(java.lang.Object o)
    Decide whether this node's children should be traversed.
    void walkJAXBElements​(java.lang.Object o)  

    Methods inherited from class org.docx4j.TraversalUtil.CallbackImpl

    getChildren

    Methods inherited from class java.lang.Object

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

    • TAB_DUMMY

      protected static final java.lang.String TAB_DUMMY
      See Also:
      Constant Field Values
    • NODE_BLOCK

      protected static final int NODE_BLOCK
      See Also:
      Constant Field Values
    • NODE_INLINE

      protected static final int NODE_INLINE
      See Also:
      Constant Field Values
    • IMAGE_E10

      protected static final int IMAGE_E10
      See Also:
      Constant Field Values
    • IMAGE_E20

      protected static final int IMAGE_E20
      See Also:
      Constant Field Values
    • conversionContext

      protected CC extends AbstractWmlConversionContext conversionContext
    • document

      protected org.w3c.dom.Document document
    • parentNode

      protected org.w3c.dom.Node parentNode
    • currentP

      protected org.w3c.dom.Element currentP
    • currentSpan

      protected org.w3c.dom.Element currentSpan
    • tr

      protected java.util.LinkedList<org.w3c.dom.Element> tr
    • tc

      protected java.util.LinkedList<org.w3c.dom.Element> tc
    • pPr

      protected PPr pPr
    • rPr

      protected RPr rPr
    • anchorOrInline

      protected java.lang.Object anchorOrInline
  • Constructor Details

    • AbstractVisitorExporterGenerator

      protected AbstractVisitorExporterGenerator​(CC conversionContext, org.w3c.dom.Document document, org.w3c.dom.Node parentNode)
  • Method Details

    • shouldTraverse

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

      protected org.w3c.dom.Node getCurrentParent()
    • convertToNode

      protected void convertToNode​(CC conversionContext, java.lang.Object unmarshalledNode, java.lang.String modelId, org.w3c.dom.Document document, org.w3c.dom.Node parentNode) throws org.w3c.dom.DOMException
      Throws:
      org.w3c.dom.DOMException
    • rtlAwareAppendChildToCurrentP

      protected void rtlAwareAppendChildToCurrentP​(org.w3c.dom.Element child)
    • walkJAXBElements

      public void walkJAXBElements​(java.lang.Object o)
      Specified by:
      walkJAXBElements in interface TraversalUtil.Callback
      Overrides:
      walkJAXBElements in class TraversalUtil.CallbackImpl
    • apply

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

      Implementations can have side effects.

      Specified by:
      apply in interface TraversalUtil.Callback
      Specified by:
      apply in class TraversalUtil.CallbackImpl
    • handleBr

      protected abstract void handleBr​(Br o)
    • getPos

      protected int getPos​(java.util.List list, java.lang.Object wanted)
    • convertTabToNode

      protected void convertTabToNode​(CC conversionContext, org.w3c.dom.Document document) throws org.w3c.dom.DOMException
      Throws:
      org.w3c.dom.DOMException
    • handlePPr

      protected abstract org.w3c.dom.Element handlePPr​(CC conversionContext, PPr pPrDirect, boolean sdt, org.w3c.dom.Element currentParent)
    • handleRPr

      protected abstract void handleRPr​(CC conversionContext, PPr pPrDirect, RPr rPrDirect, org.w3c.dom.Element currentParent)
      On a block representing a run, we just put run properties from this rPr node. The paragraph style rPr's have been taken care of on the fo block which represents the paragraph.
    • getFactory

    • createImage

      protected abstract org.w3c.dom.DocumentFragment createImage​(int imgType, CC conversionContext, java.lang.Object anchorOrInline)
    • createNode

      protected abstract org.w3c.dom.Element createNode​(org.w3c.dom.Document doc, int nodeType)
    • getLog

      protected org.slf4j.Logger getLog()