public interface StAXEventProcessor
XMLOutputter
.
People who want to create a custom XMLOutputProcessor for XMLOutputter are able to implement this interface with the following notes and restrictions:
process(XMLEventConsumer,Format,*)
methods each
time the XMLOutputter is requested to output some JDOM content. It is thus
safe to assume that a process(XMLEventConsumer,Format,*)
method can set up any
infrastructure needed to process the content, and that the XMLOutputter will
not re-call that method, or some other process(XMLEventConsumer,Format,*)
method for the same output
sequence.
process(XMLEventConsumer,Format,*)
method may (will) be called concurrently from different threads.
The AbstractXMLOutputProcessor
class is a full implementation of this
interface and is fully customisable. People who want a custom XMLOutputter
are encouraged to extend the AbstractXMLOutputProcessor rather than do a full
re-implementation of this interface.
XMLOutputter
,
AbstractXMLOutputProcessor
Modifier and Type | Method and Description |
---|---|
void |
process(XMLEventConsumer out,
Format format,
XMLEventFactory eventfactpry,
CDATA cdata)
Print out a
node. |
void |
process(XMLEventConsumer out,
Format format,
XMLEventFactory eventfactory,
Comment comment)
Print out a
. |
void |
process(XMLEventConsumer out,
Format format,
XMLEventFactory eventfactory,
DocType doctype)
Print out the
. |
void |
process(XMLEventConsumer out,
Format format,
XMLEventFactory eventfactory,
Document doc)
This will print the
to the given XMLEventConsumer. |
void |
process(XMLEventConsumer out,
Format format,
XMLEventFactory eventfactory,
Element element)
|
void |
process(XMLEventConsumer out,
Format format,
XMLEventFactory eventfactory,
EntityRef entity)
Print out a
. |
void |
process(XMLEventConsumer out,
Format format,
XMLEventFactory eventfactory,
List<? extends Content> list)
This will handle printing out a list of nodes.
|
void |
process(XMLEventConsumer out,
Format format,
XMLEventFactory eventfactory,
ProcessingInstruction pi)
Print out a
. |
void |
process(XMLEventConsumer out,
Format format,
XMLEventFactory eventfactory,
Text text)
Print out a
node. |
void process(XMLEventConsumer out, Format format, XMLEventFactory eventfactory, Document doc) throws XMLStreamException
Document
to the given XMLEventConsumer.
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.
out
- XMLEventConsumer
to use.format
- Format
instance specifying output styleeventfactory
- XMLEventFactory
for creating XMLEvent instances.doc
- Document
to format.XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is nullvoid process(XMLEventConsumer out, Format format, XMLEventFactory eventfactory, DocType doctype) throws XMLStreamException
DocType
.out
- XMLEventConsumer
to use.format
- Format
instance specifying output styleeventfactory
- XMLEventFactory
for creating XMLEvent instances.doctype
- DocType
to output.XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is nullvoid process(XMLEventConsumer out, Format format, XMLEventFactory eventfactory, Element element) throws XMLStreamException
out
- XMLEventConsumer
to use.format
- Format
instance specifying output styleeventfactory
- XMLEventFactory
for creating XMLEvent instances.element
- Element
to output.XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is nullvoid process(XMLEventConsumer out, Format format, XMLEventFactory eventfactory, List<? extends Content> list) throws XMLStreamException
out
- XMLEventConsumer
to use.format
- Format
instance specifying output styleeventfactory
- XMLEventFactory
for creating XMLEvent instances.list
- List
of nodes.XMLStreamException
- if there's any problem writing.NullPointerException
- if the input list is null or contains null membersClassCastException
- if any of the list members are not Content
void process(XMLEventConsumer out, Format format, XMLEventFactory eventfactpry, CDATA cdata) throws XMLStreamException
CDATA
node.out
- XMLEventConsumer
to use.format
- Format
instance specifying output styleeventfactpry
- XMLEventFactory
for creating XMLEvent instances.cdata
- CDATA
to output.XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is nullvoid process(XMLEventConsumer out, Format format, XMLEventFactory eventfactory, Text text) throws XMLStreamException
Text
node. Performs the necessary entity
escaping and whitespace stripping.out
- XMLEventConsumer
to use.format
- Format
instance specifying output styleeventfactory
- XMLEventFactory
for creating XMLEvent instances.text
- Text
to output.XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is nullvoid process(XMLEventConsumer out, Format format, XMLEventFactory eventfactory, Comment comment) throws XMLStreamException
Comment
.out
- XMLEventConsumer
to use.format
- Format
instance specifying output styleeventfactory
- XMLEventFactory
for creating XMLEvent instances.comment
- Comment
to output.XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is nullvoid process(XMLEventConsumer out, Format format, XMLEventFactory eventfactory, ProcessingInstruction pi) throws XMLStreamException
ProcessingInstruction
.out
- XMLEventConsumer
to use.format
- Format
instance specifying output styleeventfactory
- XMLEventFactory
for creating XMLEvent instances.pi
- ProcessingInstruction
to output.XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is nullvoid process(XMLEventConsumer out, Format format, XMLEventFactory eventfactory, EntityRef entity) throws XMLStreamException
EntityRef
.out
- XMLEventConsumer
to use.format
- Format
instance specifying output styleeventfactory
- XMLEventFactory
for creating XMLEvent instances.entity
- EntityRef
to output.XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is nullCopyright ? 2013 Jason Hunter, Brett McLaughlin. All Rights Reserved.