StAXStreamProcessor
for supporting the StAXStreamOutputter.
This class is marked abstract even though all methods are fully implemented.
The process*(...) methods are public because they match the
StAXStreamProcessor interface but the remaining methods are all protected.
People who want to create a custom StAXStreamProcessor for StAXStreamOutputter are
able to extend this class and modify any functionality they want. Before
sub-classing this you should first check to see if the Format class
can get you the results you want.
Subclasses of this should have reentrant methods. This is easiest to accomplish simply by not allowing any instance fields. If your sub-class has an instance field/variable, then it's probably broken.
One significant feature of this implementation is that it creates and
maintains both a NamespaceStack and FormatStack that are
managed in the
printElement(XMLStreamWriter, FormatStack, NamespaceStack, Element) method.
The stacks are pushed and popped in that method only. They significantly
improve the performance and readability of the code.
The NamespaceStack is only sent through to the
printElement(XMLStreamWriter, FormatStack, NamespaceStack, Element) and
printContent(XMLStreamWriter, FormatStack, NamespaceStack, Walker) methods, but
the FormatStack is pushed through to all print* Methods.
An interesting read for people using this class: Apache Axiom notes on setPrefix().
StAXStreamOutputter, StAXStreamProcessor
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | printAttribute(final XMLStreamWriter
XMLStreamWriter to use.The current FormatStack fstack, final Attribute Attribute to outputThis will handle printing of an |
| protected void | printCDATA(final XMLStreamWriter
XMLStreamWriter to use.the FormatStack fstack, final CDATA CDATA to write.This will handle printing of a |
| protected void | printComment(final XMLStreamWriter
XMLStreamWriter to use.the FormatStack fstack, final Comment Comment to write.This will handle printing of a |
| protected void | printContent(final XMLStreamWriter
XMLStreamWriter to use.the FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final Walker Walker of Content to write.This will handle printing of a List of |
| protected void | printDocType(final XMLStreamWriter
XMLStreamWriter to use.the FormatStack fstack, final DocType DocType to write.This will handle printing of a |
| protected void | printDocument(final XMLStreamWriter
XMLStreamWriter to use.the FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final Document Document to write.This will handle printing of a |
| protected void | printElement(final XMLStreamWriter
XMLStreamWriter to use.the FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final Element Element to write.This will handle printing of an |
| protected void | printEntityRef(final XMLStreamWriter
XMLStreamWriter to use.the FormatStack fstack, final EntityRef EntotyRef to write.This will handle printing of an |
| protected void | printNamespace(final XMLStreamWriter
XMLStreamWriter to use.The current FormatStack fstack, final Namespace Namespace to print definition ofThis will handle printing of any needed |
| protected void | printProcessingInstruction(final XMLStreamWriter
XMLStreamWriter to use.the FormatStack fstack, final ProcessingInstruction ProcessingInstruction to write.This will handle printing of a |
| protected void | printText(final XMLStreamWriter
XMLStreamWriter to use.the FormatStack fstack, final Text Text to write.This will handle printing of a |
| public void | process(final XMLStreamWriter
XMLStreamWriter to use.Format instance specifying output styleDocument to format.Implements org. to the given XMLStreamWriter.
|
| public void | process(final XMLStreamWriter
XMLStreamWriter to use.Format instance specifying output styleDocType to output.Implements org. .
|
| public void | process(final XMLStreamWriter
XMLStreamWriter to use.Format instance specifying output styleElement to output.Implements org. , including its
s, and all contained (child) elements, etc.
|
| public void | process(final XMLStreamWriter
XMLStreamWriter to use.Format instance specifying output styleList of nodes.Implements org. |
| public void | process(final XMLStreamWriter
XMLStreamWriter to use.Format instance specifying output styleCDATA to output.Implements org. node.
|
| public void | process(final XMLStreamWriter
XMLStreamWriter to use.Format instance specifying output styleText to output.Implements org. node.
|
| public void | process(final XMLStreamWriter
XMLStreamWriter to use.Format instance specifying output styleComment to output.Implements org. .
|
| public void | process(final XMLStreamWriter
XMLStreamWriter to use.Format instance specifying output styleProcessingInstruction to output.Implements org. .
|
| public void | process(final XMLStreamWriter
XMLStreamWriter to use.Format instance specifying output styleEntityRef to output.Implements org. .
|
| AbstractStAXStreamProcessor | back to summary |
|---|---|
| public AbstractStAXStreamProcessor() | |
| printAttribute | back to summary |
|---|---|
| protected void printAttribute(final XMLStreamWriter out, final FormatStack fstack, final Attribute attribute) throws XMLStreamException This will handle printing of an
| |
| printCDATA | back to summary |
|---|---|
| protected void printCDATA(final XMLStreamWriter out, final FormatStack fstack, final CDATA cdata) throws XMLStreamException This will handle printing of a
| |
| printComment | back to summary |
|---|---|
| protected void printComment(final XMLStreamWriter out, final FormatStack fstack, final Comment comment) throws XMLStreamException This will handle printing of a
| |
| printContent | back to summary |
|---|---|
| protected void printContent(final XMLStreamWriter out, final FormatStack fstack, final NamespaceStack nstack, final Walker walker) throws XMLStreamException This will handle printing of a List of
| |
| printDocType | back to summary |
|---|---|
| protected void printDocType(final XMLStreamWriter out, final FormatStack fstack, final DocType docType) throws XMLStreamException This will handle printing of a
| |
| printDocument | back to summary |
|---|---|
| protected void printDocument(final XMLStreamWriter out, final FormatStack fstack, final NamespaceStack nstack, final Document doc) throws XMLStreamException This will handle printing of a
| |
| printElement | back to summary |
|---|---|
| protected void printElement(final XMLStreamWriter out, final FormatStack fstack, final NamespaceStack nstack, final Element element) throws XMLStreamException This will handle printing of an
| |
| printEntityRef | back to summary |
|---|---|
| protected void printEntityRef(final XMLStreamWriter out, final FormatStack fstack, final EntityRef entity) throws XMLStreamException This will handle printing of an
| |
| printNamespace | back to summary |
|---|---|
| protected void printNamespace(final XMLStreamWriter out, final FormatStack fstack, final Namespace ns) throws XMLStreamException This will handle printing of any needed
| |
| printProcessingInstruction | back to summary |
|---|---|
| protected void printProcessingInstruction(final XMLStreamWriter out, final FormatStack fstack, final ProcessingInstruction pi) throws XMLStreamException This will handle printing of a
| |
| printText | back to summary |
|---|---|
| protected void printText(final XMLStreamWriter out, final FormatStack fstack, final Text text) throws XMLStreamException This will handle printing of a
| |
| process | back to summary |
|---|---|
| public void process(final XMLStreamWriter out, final Format format, final Document doc) throws XMLStreamException Implements org. Doc from org. This will print the Warning using your own XMLStreamWriter may cause the outputter's preferred character encoding to be ignored. If you use encodings other than UTF-8, we recommend using the method that takes an OutputStream instead.
| |
| process | back to summary |
|---|---|
| public void process(final XMLStreamWriter out, final Format format, final DocType doctype) throws XMLStreamException Implements org. Doc from org. Print out the
| |
| process | back to summary |
|---|---|
| public void process(final XMLStreamWriter out, final Format format, final Element element) throws XMLStreamException Implements org. Doc from org. Print out an
| |
| process | back to summary |
|---|---|
| public void process(final XMLStreamWriter out, final Format format, final List<? extends Content> list) throws XMLStreamException Implements org. Doc from org. This will handle printing out a list of nodes. This can be useful for printing the content of an element that contains HTML, like "<description>JDOM is <b>fun>!</description>".
| |
| process | back to summary |
|---|---|
| public void process(final XMLStreamWriter out, final Format format, final CDATA cdata) throws XMLStreamException Implements org. Doc from org. Print out a
| |
| process | back to summary |
|---|---|
| public void process(final XMLStreamWriter out, final Format format, final Text text) throws XMLStreamException Implements org. Doc from org. Print out a
| |
| process | back to summary |
|---|---|
| public void process(final XMLStreamWriter out, final Format format, final Comment comment) throws XMLStreamException Implements org. Doc from org. Print out a
| |
| process | back to summary |
|---|---|
| public void process(final XMLStreamWriter out, final Format format, final ProcessingInstruction pi) throws XMLStreamException Implements org. Doc from org. Print out a
| |
| process | back to summary |
|---|---|
| public void process(final XMLStreamWriter out, final Format format, final EntityRef entity) throws XMLStreamException Implements org. Doc from org. Print out a
| |