Class XmlNode
java.lang.Object
com.northconcepts.datapipeline.xml.builder.XmlNode
- Direct Known Subclasses:
XmlNodeContainer,XmlText
Base class for the nodes of an
XmlTemplate; each writes its opening and closing markup to a CodeWriter.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChildNodes(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 intReturns how many elements enclose this node, including itself if it is an element; used for indentation.intReturns the element depth of the last child node, looking inside non-element children, or this node's own depth if it has none.booleanhasChildNodes(ExpressionContext context) Returns true if this node has children to write in the given context; a conditional node also requires its condition.booleanisMarker(ExpressionContext context) Returns true for theXmlDetailMarkerthat marks where each record is written.final voidwriteEnd(ExpressionContext context, CodeWriter writer) Writes this node's closing output, wrapping any failure in aDataException.protected abstract voidwriteEndImpl(ExpressionContext context, CodeWriter writer) Writes this node's closing output, such as an element's end tag, after its children are written.final voidwriteStart(ExpressionContext context, CodeWriter writer) Writes this node's opening output, wrapping any failure in aDataException.protected abstract voidwriteStartImpl(ExpressionContext context, CodeWriter writer) Writes this node's opening output, such as an element's start tag or a text node's content.
-
Field Details
-
parent
-
-
Constructor Details
-
XmlNode
-
-
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
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
Writes this node's opening output, wrapping any failure in aDataException. -
writeEnd
Writes this node's closing output, wrapping any failure in aDataException. -
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
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 theXmlDetailMarkerthat marks where each record is written.
-