Class XmlNodeContainer

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

public abstract class XmlNodeContainer extends XmlNode
Base class for template nodes with children; provides the element(String), text(String), when(String) and detail() builder methods.
  • Constructor Details

  • Method Details

    • getNodes

      public List<XmlNode> getNodes()
    • getLastChildNodeElementDepth

      public int getLastChildNodeElementDepth()
      Description copied from class: XmlNode
      Returns the element depth of the last child node, looking inside non-element children, or this node's own depth if it has none.
      Overrides:
      getLastChildNodeElementDepth in class XmlNode
    • hasChildNodes

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

      public List<XmlNode> getChildNodes(ExpressionContext context)
      Description copied from class: XmlNode
      Returns the children to write in the given context, or null for leaf nodes and for conditional nodes whose condition is false.
      Overrides:
      getChildNodes in class XmlNode
    • add

      public <T extends XmlNode> T add(T node)
      Appends the node as a child and returns the added node.
    • when

      public final XmlConditionalNode when(String condition)
      Adds and returns a group of nodes written only when the given logical expression is true.
    • element

      public final XmlElement element(String name)
      Adds and returns a child element named by the given expression; quote a fixed name, as in 'actor'.
    • text

      public final XmlNodeContainer text(String text)
      Adds text computed from the given expression, written XML-escaped, and returns this container (not the text node).
    • detail

      public final XmlNodeContainer detail()
      Adds and returns the detail marker; the nodes added to it are written once for each record.