StAXEventProcessor
for supporting the StAXEventOutputter.
This class is marked abstract even though all methods are fully implemented.
The process*(...) methods are public because they match the
StAXEventProcessor interface but the remaining methods are all protected.
People who want to create a custom StAXEventProcessor for StAXEventOutputter 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(XMLEventConsumer, FormatStack, NamespaceStack, XMLEventFactory, 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(XMLEventConsumer, FormatStack, NamespaceStack, XMLEventFactory, Element) and
printContent(XMLEventConsumer, FormatStack, NamespaceStack, XMLEventFactory, Walker) methods, but
the FormatStack is pushed through to all print* Methods.
StAXEventOutputter, StAXEventProcessor
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | printCDATA(final XMLEventConsumer
XMLEventConsumer to use.the FormatStack fstack, final XMLEventFactory The XMLEventFactory for creating XMLEvents eventfactory, final CDATA CDATA to write.This will handle printing of a |
| protected void | printComment(final XMLEventConsumer
XMLEventConsumer to use.the FormatStack fstack, final XMLEventFactory The XMLEventFactory for creating XMLEvents eventfactory, final Comment Comment to write.This will handle printing of a |
| protected void | printContent(final XMLEventConsumer
XMLEventConsumer to use.the FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final XMLEventFactory The XMLEventFactory for creating XMLEvents eventfactory, final Walker Walker of Content to write.This will handle printing of a List of |
| protected void | printDocType(final XMLEventConsumer
XMLEventConsumer to use.the FormatStack fstack, final XMLEventFactory The XMLEventFactory for creating XMLEvents eventfactory, final DocType DocType to write.This will handle printing of a |
| protected void | printDocument(final XMLEventConsumer
XMLEventConsumer to use.the FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final XMLEventFactory The XMLEventFactory for creating XMLEvents eventfactory, final Document Document to write.This will handle printing of a |
| protected void | printElement(final XMLEventConsumer
XMLEventConsumer to use.the FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final XMLEventFactory The XMLEventFactory for creating XMLEvents eventfactory, final Element Element to write.This will handle printing of an |
| protected void | printEntityRef(final XMLEventConsumer
XMLEventConsumer to use.the FormatStack fstack, final XMLEventFactory The XMLEventFactory for creating XMLEvents eventfactory, final EntityRef EntotyRef to write.This will handle printing of an |
| protected void | printProcessingInstruction(final XMLEventConsumer
XMLEventConsumer to use.the FormatStack fstack, final XMLEventFactory The XMLEventFactory for creating XMLEvents eventfactory, final ProcessingInstruction ProcessingInstruction to write.This will handle printing of a |
| protected void | printText(final XMLEventConsumer
XMLEventConsumer to use.the FormatStack fstack, final XMLEventFactory The XMLEventFactory for creating XMLEvents eventfactory, final Text Text to write.This will handle printing of a |
| public void | process(final XMLEventConsumer
XMLEventConsumer to use.Format instance specifying output styleXMLEventFactory for creating XMLEvent instances.Document to format.Implements org. to the given XMLEventConsumer.
|
| public void | process(final XMLEventConsumer
XMLEventConsumer to use.Format instance specifying output styleXMLEventFactory for creating XMLEvent instances.DocType to output.Implements org. .
|
| public void | process(final XMLEventConsumer
XMLEventConsumer to use.Format instance specifying output styleXMLEventFactory for creating XMLEvent instances.Element to output.Implements org. , including its
s, and all contained (child) elements, etc.
|
| public void | process(final XMLEventConsumer
XMLEventConsumer to use.Format instance specifying output styleXMLEventFactory for creating XMLEvent instances.List of nodes.Implements org. |
| public void | process(final XMLEventConsumer
XMLEventConsumer to use.Format instance specifying output styleXMLEventFactory for creating XMLEvent instances.CDATA to output.Implements org. node.
|
| public void | process(final XMLEventConsumer
XMLEventConsumer to use.Format instance specifying output styleXMLEventFactory for creating XMLEvent instances.Text to output.Implements org. node.
|
| public void | process(final XMLEventConsumer
XMLEventConsumer to use.Format instance specifying output styleXMLEventFactory for creating XMLEvent instances.Comment to output.Implements org. .
|
| public void | process(final XMLEventConsumer
XMLEventConsumer to use.Format instance specifying output styleXMLEventFactory for creating XMLEvent instances.ProcessingInstruction to output.Implements org. .
|
| public void | process(final XMLEventConsumer
XMLEventConsumer to use.Format instance specifying output styleXMLEventFactory for creating XMLEvent instances.EntityRef to output.Implements org. .
|
| AbstractStAXEventProcessor | back to summary |
|---|---|
| public AbstractStAXEventProcessor() | |
| printCDATA | back to summary |
|---|---|
| protected void printCDATA(final XMLEventConsumer out, final FormatStack fstack, final XMLEventFactory eventfactory, final CDATA cdata) throws XMLStreamException This will handle printing of a
| |
| printComment | back to summary |
|---|---|
| protected void printComment(final XMLEventConsumer out, final FormatStack fstack, final XMLEventFactory eventfactory, final Comment comment) throws XMLStreamException This will handle printing of a
| |
| printContent | back to summary |
|---|---|
| protected void printContent(final XMLEventConsumer out, final FormatStack fstack, final NamespaceStack nstack, final XMLEventFactory eventfactory, final Walker walker) throws XMLStreamException This will handle printing of a List of
| |
| printDocType | back to summary |
|---|---|
| protected void printDocType(final XMLEventConsumer out, final FormatStack fstack, final XMLEventFactory eventfactory, final DocType docType) throws XMLStreamException This will handle printing of a
| |
| printDocument | back to summary |
|---|---|
| protected void printDocument(final XMLEventConsumer out, final FormatStack fstack, final NamespaceStack nstack, final XMLEventFactory eventfactory, final Document doc) throws XMLStreamException This will handle printing of a
| |
| printElement | back to summary |
|---|---|
| protected void printElement(final XMLEventConsumer out, final FormatStack fstack, final NamespaceStack nstack, final XMLEventFactory eventfactory, final Element element) throws XMLStreamException This will handle printing of an This method arranges for outputting the Element infrastructure including Namespace Declarations and Attributes.
| |
| printEntityRef | back to summary |
|---|---|
| protected void printEntityRef(final XMLEventConsumer out, final FormatStack fstack, final XMLEventFactory eventfactory, final EntityRef entity) throws XMLStreamException This will handle printing of an
| |
| printProcessingInstruction | back to summary |
|---|---|
| protected void printProcessingInstruction(final XMLEventConsumer out, final FormatStack fstack, final XMLEventFactory eventfactory, final ProcessingInstruction pi) throws XMLStreamException This will handle printing of a
| |
| printText | back to summary |
|---|---|
| protected void printText(final XMLEventConsumer out, final FormatStack fstack, final XMLEventFactory eventfactory, final Text text) throws XMLStreamException This will handle printing of a
| |
| process | back to summary |
|---|---|
| public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final Document doc) throws XMLStreamException Implements org. Doc from org. This will print the Warning using your own XMLEventConsumer 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 XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final DocType doctype) throws XMLStreamException Implements org. Doc from org. Print out the
| |
| process | back to summary |
|---|---|
| public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final Element element) throws XMLStreamException Implements org. Doc from org. Print out an
| |
| process | back to summary |
|---|---|
| public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, 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 XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final CDATA cdata) throws XMLStreamException Implements org. Doc from org. Print out a
| |
| process | back to summary |
|---|---|
| public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final Text text) throws XMLStreamException Implements org. Doc from org. Print out a
| |
| process | back to summary |
|---|---|
| public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final Comment comment) throws XMLStreamException Implements org. Doc from org. Print out a
| |
| process | back to summary |
|---|---|
| public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final ProcessingInstruction pi) throws XMLStreamException Implements org. Doc from org. Print out a
| |
| process | back to summary |
|---|---|
| public void process(final XMLEventConsumer out, final Format format, final XMLEventFactory eventfactory, final EntityRef entity) throws XMLStreamException Implements org. Doc from org. Print out a
| |
| Modifier and Type | Field and Description |
|---|---|
| private final XMLEventFactory | |
| private final Iterator |
| Access | Constructor and Description |
|---|---|
| public | AttIterator(final Iterator<Attribute> source, final XMLEventFactory fac, final boolean specifiedAttributesOnly)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Attribute | |
| public void | remove()
Overrides default java. |
| private Iterator |
| fac | back to summary |
|---|---|
| private final XMLEventFactory fac | |
| source | back to summary |
|---|---|
| private final Iterator<Attribute> source | |
| AttIterator | back to summary |
|---|---|
| public AttIterator(final Iterator<Attribute> source, final XMLEventFactory fac, final boolean specifiedAttributesOnly) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public Attribute next() Implements java. Doc from java. Returns the next element in the iteration. | |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |
| specified | back to summary |
|---|---|
| private Iterator | |
| Modifier and Type | Field and Description |
|---|---|
| private final XMLEventFactory | |
| private final Iterator |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Namespace | |
| public void | remove()
Overrides default java. |
| fac | back to summary |
|---|---|
| private final XMLEventFactory fac | |
| source | back to summary |
|---|---|
| private final Iterator<Namespace> source | |
| NSIterator | back to summary |
|---|---|
| public NSIterator(Iterator<Namespace> source, XMLEventFactory fac) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public Namespace next() Implements java. Doc from java. Returns the next element in the iteration. | |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |