Class XmlConditionalNode


public class XmlConditionalNode extends XmlNodeContainer
A group of template nodes written only when its logical expression is true; created by XmlNodeContainer.when(String).
  • Constructor Details

  • Method Details

    • getCondition

      public XmlLogicalExpression getCondition()
    • 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 XmlNodeContainer
    • 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 XmlNodeContainer
    • writeStartImpl

      protected void writeStartImpl(ExpressionContext context, CodeWriter writer) throws Throwable
      Description copied from class: XmlNode
      Writes this node's opening output, such as an element's start tag or a text node's content.
      Specified by:
      writeStartImpl in class XmlNode
      Throws:
      Throwable
    • writeEndImpl

      protected void writeEndImpl(ExpressionContext context, CodeWriter writer) throws Throwable
      Description copied from class: XmlNode
      Writes this node's closing output, such as an element's end tag, after its children are written.
      Specified by:
      writeEndImpl in class XmlNode
      Throws:
      Throwable