java.lang.Object
com.northconcepts.datapipeline.xml.builder.XmlNode
Direct Known Subclasses:
XmlNodeContainer, XmlText

public abstract class XmlNode extends Object
Base class for the nodes of an XmlTemplate; each writes its opening and closing markup to a CodeWriter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final XmlNodeContainer
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getChildNodes(ExpressionContext context)
    Returns the children to write in the given context, or null for leaf nodes and for conditional nodes whose condition is false.
    protected int
    Returns how many elements enclose this node, including itself if it is an element; used for indentation.
    int
    Returns the element depth of the last child node, looking inside non-element children, or this node's own depth if it has none.
    boolean
    hasChildNodes(ExpressionContext context)
    Returns true if this node has children to write in the given context; a conditional node also requires its condition.
    boolean
    isMarker(ExpressionContext context)
    Returns true for the XmlDetailMarker that marks where each record is written.
    final void
    writeEnd(ExpressionContext context, CodeWriter writer)
    Writes this node's closing output, wrapping any failure in a DataException.
    protected abstract void
    writeEndImpl(ExpressionContext context, CodeWriter writer)
    Writes this node's closing output, such as an element's end tag, after its children are written.
    final void
    writeStart(ExpressionContext context, CodeWriter writer)
    Writes this node's opening output, wrapping any failure in a DataException.
    protected abstract void
    writeStartImpl(ExpressionContext context, CodeWriter writer)
    Writes this node's opening output, such as an element's start tag or a text node's content.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • writeStartImpl

      protected abstract void writeStartImpl(ExpressionContext context, CodeWriter writer) throws Throwable
      Writes this node's opening output, such as an element's start tag or a text node's content.
      Throws:
      Throwable
    • writeEndImpl

      protected abstract void writeEndImpl(ExpressionContext context, CodeWriter writer) throws Throwable
      Writes this node's closing output, such as an element's end tag, after its children are written.
      Throws:
      Throwable
    • getElementDepth

      protected int getElementDepth()
      Returns how many elements enclose this node, including itself if it is an element; used for indentation.
    • getLastChildNodeElementDepth

      public int getLastChildNodeElementDepth()
      Returns the element depth of the last child node, looking inside non-element children, or this node's own depth if it has none.
    • writeStart

      public final void writeStart(ExpressionContext context, CodeWriter writer)
      Writes this node's opening output, wrapping any failure in a DataException.
    • writeEnd

      public final void writeEnd(ExpressionContext context, CodeWriter writer)
      Writes this node's closing output, wrapping any failure in a DataException.
    • hasChildNodes

      public boolean hasChildNodes(ExpressionContext context)
      Returns true if this node has children to write in the given context; a conditional node also requires its condition.
    • getChildNodes

      public List<XmlNode> getChildNodes(ExpressionContext context)
      Returns the children to write in the given context, or null for leaf nodes and for conditional nodes whose condition is false.
    • isMarker

      public boolean isMarker(ExpressionContext context)
      Returns true for the XmlDetailMarker that marks where each record is written.