jd.xml.xslt.result
Class XmlResultBuilder

java.lang.Object
  extended byjd.xml.xslt.result.ResultBuilder
      extended byjd.xml.xslt.result.MarkupResultBuilder
          extended byjd.xml.xslt.result.XmlResultBuilder

public final class XmlResultBuilder
extends MarkupResultBuilder

A ResultBuilder that builds a xml file.


Field Summary
 
Fields inherited from class jd.xml.xslt.result.MarkupResultBuilder
attributes_, BUFFER_SIZE, elementStarted_, encoding_, indent_, MAX_POS, nsSupport_, outAutoFlush_, outNewLine_, output_, outputFormat_, result_, UTF_8
 
Constructor Summary
XmlResultBuilder(XsltResult result)
          Create a new XmlResultBuilder.
 
Method Summary
 void addProcessingInstruction(String target, String data)
          Add a processing instruction to the output.
 void addText(String text)
          Add text to the output.
 void addTextUnescaped(String textString)
          Add text to the output.
 void endElement()
          End an element output.
protected  void flushNode(boolean addContent)
          Flush buffered content (i.e.
protected  void printLineBreak()
          Inserts linebreaks if indent mode is on.
 void startDocument(OutputFormat outputFormat)
          Start the document.
 void startElement(String namespaceUri, String name, NamespaceContext namespaceContext, boolean isCDataSectionElement)
          Start a element output.
 
Methods inherited from class jd.xml.xslt.result.MarkupResultBuilder
addAttribute, addComment, addNamespace, cleanup, decreasePrintIndent, endDocument, getNamespacePrefix, increasePrintIndent, printAttribute, printCharReference, printCharReference, printIndent, println
 
Methods inherited from class jd.xml.xslt.result.ResultBuilder
addAttribute, convertException, getSubResultBuilder, getUri, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlResultBuilder

public XmlResultBuilder(XsltResult result)
Create a new XmlResultBuilder.

Method Detail

startDocument

public void startDocument(OutputFormat outputFormat)
Start the document.

Overrides:
startDocument in class MarkupResultBuilder

startElement

public void startElement(String namespaceUri,
                         String name,
                         NamespaceContext namespaceContext,
                         boolean isCDataSectionElement)
Start a element output.

Specified by:
startElement in class ResultBuilder
Parameters:
namespaceUri - the namespace of the element or null if it has none
name - the element name
namespaceContext - the namespace context of the element.

endElement

public void endElement()
End an element output.

Specified by:
endElement in class ResultBuilder

addProcessingInstruction

public void addProcessingInstruction(String target,
                                     String data)
Add a processing instruction to the output.

Specified by:
addProcessingInstruction in class ResultBuilder

addTextUnescaped

public void addTextUnescaped(String textString)
Add text to the output.

Specified by:
addTextUnescaped in class ResultBuilder

addText

public void addText(String text)
Add text to the output.

Specified by:
addText in class ResultBuilder

printLineBreak

protected void printLineBreak()
Inserts linebreaks if indent mode is on. The method is called if when an element starts, ends, or a pi or comment is printed. A linebreak is not inserted iif the the current line is empty or a non whitespace text was printed before.

Specified by:
printLineBreak in class MarkupResultBuilder

flushNode

protected void flushNode(boolean addContent)
Flush buffered content (i.e. start of elements or text).

Specified by:
flushNode in class MarkupResultBuilder