public interface SAXOutputProcessor
SAXOutputter
.
People who want to create a custom SAXOutputProcessor for SAXOutputter are able to implement this interface with the following notes and restrictions:
process(SAXTarget,Format,*)
methods each time the SAXOutputter
is requested to output some JDOM content. It is thus safe to assume that a
process(SAXTarget,Format,*)
method can set up any infrastructure
needed to process the content, and that the SAXOutputter will not re-call
that method, or some other process(SAXTarget,Format,*)
method
for the same output sequence.
process(SAXTarget,Format,*)
method may (will) be called
concurrently from different threads.
The AbstractSAXOutputProcessor
class is a full implementation of this
interface and is fully customisable. People who want a custom SAXOutputter
are encouraged to extend the AbstractSAXOutputProcessor rather than do a full
re-implementation of this interface.
SAXOutputter
,
AbstractSAXOutputProcessor
Modifier and Type | Method and Description |
---|---|
void |
process(SAXTarget out,
Format format,
CDATA cdata)
Print out a
node. |
void |
process(SAXTarget out,
Format format,
Comment comment)
Print out a
. |
void |
process(SAXTarget out,
Format format,
DocType doctype)
Print out the
. |
void |
process(SAXTarget out,
Format format,
Document doc)
This will print the
to the given SAXTarget. |
void |
process(SAXTarget out,
Format format,
Element element)
|
void |
process(SAXTarget out,
Format format,
EntityRef entity)
Print out a
. |
void |
process(SAXTarget out,
Format format,
java.util.List<? extends Content> list)
This will handle printing out a list of nodes.
|
void |
process(SAXTarget out,
Format format,
ProcessingInstruction pi)
Print out a
. |
void |
process(SAXTarget out,
Format format,
Text text)
Print out a
node. |
void |
processAsDocument(SAXTarget out,
Format format,
Element element)
|
void |
processAsDocument(SAXTarget out,
Format format,
java.util.List<? extends Content> list)
This will handle printing out a list of nodes that is encapsulated in
start/end Document SAX events.
|
void process(SAXTarget out, Format format, Document doc) throws JDOMException
Document
to the given SAXTarget.
Warning: using your own SAXTarget 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
- SAXTarget
to use.format
- Format
instance specifying output styledoc
- Document
to format.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input content is nullvoid process(SAXTarget out, Format format, DocType doctype) throws JDOMException
DocType
.out
- SAXTarget
to use.format
- Format
instance specifying output styledoctype
- DocType
to output.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input content is nullvoid process(SAXTarget out, Format format, Element element) throws JDOMException
out
- SAXTarget
to use.format
- Format
instance specifying output styleelement
- Element
to output.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input content is nullvoid processAsDocument(SAXTarget out, Format format, Element element) throws JDOMException
Element
encapsulated in start/end
Document SAX events, including its Attribute
s, and
all contained (child) elements, etc.out
- SAXTarget
to use.format
- Format
instance specifying output styleelement
- Element
to output.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input content is nullvoid process(SAXTarget out, Format format, java.util.List<? extends Content> list) throws JDOMException
out
- SAXTarget
to use.format
- Format
instance specifying output stylelist
- List
of nodes.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input list is null or contains null membersjava.lang.ClassCastException
- if any of the list members are not Content
void processAsDocument(SAXTarget out, Format format, java.util.List<? extends Content> list) throws JDOMException
out
- SAXTarget
to use.format
- Format
instance specifying output stylelist
- List
of nodes.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input list is null or contains null membersjava.lang.ClassCastException
- if any of the list members are not Content
void process(SAXTarget out, Format format, CDATA cdata) throws JDOMException
CDATA
node.out
- SAXTarget
to use.format
- Format
instance specifying output stylecdata
- CDATA
to output.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input content is nullvoid process(SAXTarget out, Format format, Text text) throws JDOMException
Text
node. Performs the necessary entity
escaping and whitespace stripping.out
- SAXTarget
to use.format
- Format
instance specifying output styletext
- Text
to output.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input content is nullvoid process(SAXTarget out, Format format, Comment comment) throws JDOMException
Comment
.out
- SAXTarget
to use.format
- Format
instance specifying output stylecomment
- Comment
to output.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input content is nullvoid process(SAXTarget out, Format format, ProcessingInstruction pi) throws JDOMException
ProcessingInstruction
.out
- SAXTarget
to use.format
- Format
instance specifying output stylepi
- ProcessingInstruction
to output.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input content is nullvoid process(SAXTarget out, Format format, EntityRef entity) throws JDOMException
EntityRef
.out
- SAXTarget
to use.format
- Format
instance specifying output styleentity
- EntityRef
to output.JDOMException
- if there is an issue encountered during output.java.lang.NullPointerException
- if the input content is nullCopyright © 2021 Jason Hunter, Brett McLaughlin. All Rights Reserved.