Package org.jdom2.output.support
Interface StAXStreamProcessor
- All Known Implementing Classes:
AbstractStAXStreamProcessor
public interface StAXStreamProcessor
This interface provides a base support for the
StAXStreamOutputter
.
People who want to create a custom StAXStreamProcessor for StAXStreamOutputter are able to implement this interface.
The AbstractStAXStreamProcessor
class is a full implementation of this
interface and is fully customisable. People who want a custom StAXStreamOutputter
are encouraged to extend the AbstractStAXStreamProcessor rather than do a full
re-implementation of this interface.
- Since:
- JDOM2
- Author:
- Rolf Lear
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
process
(XMLStreamWriter out, Format format, List<? extends Content> list) This will handle printing out a list of nodes.void
process
(XMLStreamWriter out, Format format, CDATA cdata) Print out a
node.CDATA
void
process
(XMLStreamWriter out, Format format, Comment comment) Print out a
.Comment
void
process
(XMLStreamWriter out, Format format, DocType doctype) Print out the
.DocType
void
process
(XMLStreamWriter out, Format format, Document doc) This will print the
to the given XMLStreamWriter.Document
void
process
(XMLStreamWriter out, Format format, Element element) void
process
(XMLStreamWriter out, Format format, EntityRef entity) Print out a
.EntityRef
void
process
(XMLStreamWriter out, Format format, ProcessingInstruction pi) Print out a
.ProcessingInstruction
void
process
(XMLStreamWriter out, Format format, Text text) Print out a
node.Text
-
Method Details
-
process
This will print the
to the given XMLStreamWriter.Document
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.
- Parameters:
out
-XMLStreamWriter
to use.format
-Format
instance specifying output styledoc
-Document
to format.- Throws:
XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is null
-
process
Print out the
.DocType
- Parameters:
out
-XMLStreamWriter
to use.format
-Format
instance specifying output styledoctype
-DocType
to output.- Throws:
XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is null
-
process
- Parameters:
out
-XMLStreamWriter
to use.format
-Format
instance specifying output styleelement
-Element
to output.- Throws:
XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is null
-
process
void process(XMLStreamWriter out, Format format, List<? extends Content> list) throws XMLStreamException 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>".- Parameters:
out
-XMLStreamWriter
to use.format
-Format
instance specifying output stylelist
-List
of nodes.- Throws:
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 notContent
-
process
Print out a
node.CDATA
- Parameters:
out
-XMLStreamWriter
to use.format
-Format
instance specifying output stylecdata
-CDATA
to output.- Throws:
XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is null
-
process
Print out a
node. Performs the necessary entity escaping and whitespace stripping.Text
- Parameters:
out
-XMLStreamWriter
to use.format
-Format
instance specifying output styletext
-Text
to output.- Throws:
XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is null
-
process
Print out a
.Comment
- Parameters:
out
-XMLStreamWriter
to use.format
-Format
instance specifying output stylecomment
-Comment
to output.- Throws:
XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is null
-
process
void process(XMLStreamWriter out, Format format, ProcessingInstruction pi) throws XMLStreamException Print out a
.ProcessingInstruction
- Parameters:
out
-XMLStreamWriter
to use.format
-Format
instance specifying output stylepi
-ProcessingInstruction
to output.- Throws:
XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is null
-
process
Print out a
.EntityRef
- Parameters:
out
-XMLStreamWriter
to use.format
-Format
instance specifying output styleentity
-EntityRef
to output.- Throws:
XMLStreamException
- if there's any problem writing.NullPointerException
- if the input content is null
-