public class AbstractSAXOutputProcessor extends AbstractOutputProcessor implements SAXOutputProcessor
Most ContentHandler callbacks are supported. Neither
ignorableWhitespace() nor skippedEntity() have been
implemented.
At this time, it is not possible to access notations and unparsed entity
references in a DTD from JDOM. Therefore, full DTDHandler
call-backs have not been implemented yet.
The ErrorHandler call-backs have not been implemented, since
these are supposed to be invoked when the document is parsed and at this
point the document exists in memory and is known to have no errors.
| Constructor and Description |
|---|
AbstractSAXOutputProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected org.xml.sax.XMLReader |
createParser()
Creates a SAX XMLReader.
|
protected void |
printCDATA(SAXTarget out,
FormatStack fstack,
CDATA cdata)
This will handle printing of a
CDATA. |
protected void |
printComment(SAXTarget out,
FormatStack fstack,
Comment comment)
This will handle printing of a
Comment. |
protected void |
printContent(SAXTarget out,
FormatStack fstack,
NamespaceStack nstack,
Walker walker)
This will handle printing of a List of
Content. |
protected void |
printDocType(SAXTarget out,
FormatStack fstack,
DocType docType)
This will handle printing of a
DocType. |
protected void |
printDocument(SAXTarget out,
FormatStack fstack,
NamespaceStack nstack,
Document document)
This will handle printing of a
Document. |
protected void |
printElement(SAXTarget out,
FormatStack fstack,
NamespaceStack nstack,
Element element)
This will handle printing of an
Element. |
protected void |
printEntityRef(SAXTarget out,
FormatStack fstack,
EntityRef entity)
This will handle printing of an
EntityRef. |
protected void |
printProcessingInstruction(SAXTarget out,
FormatStack fstack,
ProcessingInstruction pi)
This will handle printing of a
ProcessingInstruction. |
protected void |
printText(SAXTarget out,
FormatStack fstack,
Text text)
This will handle printing of a
Text. |
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 node)
|
void |
processAsDocument(SAXTarget out,
Format format,
java.util.List<? extends Content> nodes)
This will handle printing out a list of nodes that is encapsulated in
start/end Document SAX events.
|
buildWalkerpublic void process(SAXTarget out, Format format, Document doc) throws JDOMException
SAXOutputProcessorDocument 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.
process in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output styledoc - Document to format.JDOMException - if there is an issue encountered during output.public void process(SAXTarget out, Format format, DocType doctype) throws JDOMException
SAXOutputProcessorDocType.process in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output styledoctype - DocType to output.JDOMException - if there is an issue encountered during output.public void process(SAXTarget out, Format format, Element element) throws JDOMException
SAXOutputProcessorprocess in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output styleelement - Element to output.JDOMException - if there is an issue encountered during output.public void process(SAXTarget out, Format format, java.util.List<? extends Content> list) throws JDOMException
SAXOutputProcessorprocess in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output stylelist - List of nodes.JDOMException - if there is an issue encountered during output.public void process(SAXTarget out, Format format, CDATA cdata) throws JDOMException
SAXOutputProcessorCDATA node.process in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output stylecdata - CDATA to output.JDOMException - if there is an issue encountered during output.public void process(SAXTarget out, Format format, Text text) throws JDOMException
SAXOutputProcessorText node. Performs the necessary entity
escaping and whitespace stripping.process in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output styletext - Text to output.JDOMException - if there is an issue encountered during output.public void process(SAXTarget out, Format format, Comment comment) throws JDOMException
SAXOutputProcessorComment.process in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output stylecomment - Comment to output.JDOMException - if there is an issue encountered during output.public void process(SAXTarget out, Format format, ProcessingInstruction pi) throws JDOMException
SAXOutputProcessorProcessingInstruction.process in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output stylepi - ProcessingInstruction to output.JDOMException - if there is an issue encountered during output.public void process(SAXTarget out, Format format, EntityRef entity) throws JDOMException
SAXOutputProcessorEntityRef.process in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output styleentity - EntityRef to output.JDOMException - if there is an issue encountered during output.public void processAsDocument(SAXTarget out, Format format, java.util.List<? extends Content> nodes) throws JDOMException
SAXOutputProcessorprocessAsDocument in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output stylenodes - List of nodes.JDOMException - if there is an issue encountered during output.public void processAsDocument(SAXTarget out, Format format, Element node) throws JDOMException
SAXOutputProcessorElement encapsulated in start/end
Document SAX events, including its Attributes, and
all contained (child) elements, etc.processAsDocument in interface SAXOutputProcessorout - SAXTarget to use.format - Format instance specifying output stylenode - Element to output.JDOMException - if there is an issue encountered during output.protected void printDocument(SAXTarget out, FormatStack fstack, NamespaceStack nstack, Document document) throws org.xml.sax.SAXException
Document.out - SAXTarget to use.fstack - the FormatStacknstack - the NamespaceStackdocument - Document to write.org.xml.sax.SAXException - if the destination SAXTarget failsprotected void printDocType(SAXTarget out, FormatStack fstack, DocType docType) throws org.xml.sax.SAXException
DocType.out - SAXTarget to use.fstack - the FormatStackdocType - DocType to write.org.xml.sax.SAXException - if the destination SAXTarget failsprotected void printProcessingInstruction(SAXTarget out, FormatStack fstack, ProcessingInstruction pi) throws org.xml.sax.SAXException
ProcessingInstruction.out - SAXTarget to use.fstack - the FormatStackpi - ProcessingInstruction to write.org.xml.sax.SAXException - if the destination SAXTarget failsprotected void printComment(SAXTarget out, FormatStack fstack, Comment comment) throws org.xml.sax.SAXException
Comment.out - SAXTarget to use.fstack - the FormatStackcomment - Comment to write.org.xml.sax.SAXException - if the destination SAXTarget failsprotected void printEntityRef(SAXTarget out, FormatStack fstack, EntityRef entity) throws org.xml.sax.SAXException
EntityRef.out - SAXTarget to use.fstack - the FormatStackentity - EntotyRef to write.org.xml.sax.SAXException - if the destination SAXTarget failsprotected void printCDATA(SAXTarget out, FormatStack fstack, CDATA cdata) throws org.xml.sax.SAXException
CDATA.out - SAXTarget to use.fstack - the FormatStackcdata - CDATA to write.org.xml.sax.SAXException - if the destination SAXTarget failsprotected void printText(SAXTarget out, FormatStack fstack, Text text) throws org.xml.sax.SAXException
Text.out - SAXTarget to use.fstack - the FormatStacktext - Text to write.org.xml.sax.SAXException - if the destination SAXTarget failsprotected void printElement(SAXTarget out, FormatStack fstack, NamespaceStack nstack, Element element) throws org.xml.sax.SAXException
Element.
This method arranges for outputting the Element infrastructure including Namespace Declarations and Attributes.
out - SAXTarget to use.fstack - the FormatStacknstack - the NamespaceStackelement - Element to write.org.xml.sax.SAXException - if the destination SAXTarget failsprotected void printContent(SAXTarget out, FormatStack fstack, NamespaceStack nstack, Walker walker) throws org.xml.sax.SAXException
Content.
It relies on the appropriate Walker to get the formatting right.
out - SAXTarget to use.fstack - the FormatStacknstack - the NamespaceStackwalker - Waker of Content to write.org.xml.sax.SAXException - if the destination SAXTarget failsprotected org.xml.sax.XMLReader createParser()
throws java.lang.Exception
Creates a SAX XMLReader.
XMLReader a SAX2 parser.java.lang.Exception - if no parser can be created.Copyright © 2021 Jason Hunter, Brett McLaughlin. All Rights Reserved.