Package org.jdom.output.support
Interface SAXOutputProcessor
-
- All Known Implementing Classes:
AbstractSAXOutputProcessor
public interface SAXOutputProcessorThis interface provides a base support for theSAXOutputter.People who want to create a custom SAXOutputProcessor for SAXOutputter are able to implement this interface with the following notes and restrictions:
- The SAXOutputter will call one, and only one of the
process(SAXTarget,Format,*)methods each time the SAXOutputter is requested to output some JDOM content. It is thus safe to assume that aprocess(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 otherprocess(SAXTarget,Format,*)method for the same output sequence. - The process methods should be thread-safe and reentrant: The same
process(SAXTarget,Format,*)method may (will) be called concurrently from different threads.
The
AbstractSAXOutputProcessorclass 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.- Since:
- JDOM2
- See Also:
SAXOutputter,AbstractSAXOutputProcessor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidprocess(SAXTarget out, Format format, List<? extends Content> list)This will handle printing out a list of nodes.voidprocess(SAXTarget out, Format format, CDATA cdata)Print out anode.CDATAvoidprocess(SAXTarget out, Format format, Comment comment)Print out a.Commentvoidprocess(SAXTarget out, Format format, DocType doctype)Print out the.DocTypevoidprocess(SAXTarget out, Format format, Document doc)This will print theto the given SAXTarget.Documentvoidprocess(SAXTarget out, Format format, Element element)voidprocess(SAXTarget out, Format format, EntityRef entity)Print out a.EntityRefvoidprocess(SAXTarget out, Format format, ProcessingInstruction pi)Print out a.ProcessingInstructionvoidprocess(SAXTarget out, Format format, Text text)Print out anode.TextvoidprocessAsDocument(SAXTarget out, Format format, List<? extends Content> list)This will handle printing out a list of nodes thats encapsulated in start/end Document SAX events.voidprocessAsDocument(SAXTarget out, Format format, Element element)
-
-
-
Method Detail
-
process
void process(SAXTarget out, Format format, Document doc) throws JDOMException
This will print theto the given SAXTarget.DocumentWarning: 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.
- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output styledoc-Documentto format.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input content is null
-
process
void process(SAXTarget out, Format format, DocType doctype) throws JDOMException
Print out the.DocType- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output styledoctype-DocTypeto output.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input content is null
-
process
void process(SAXTarget out, Format format, Element element) throws JDOMException
- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output styleelement-Elementto output.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input content is null
-
processAsDocument
void processAsDocument(SAXTarget out, Format format, Element element) throws JDOMException
Print out anencapsulated in start/end Document SAX events, including itsElements, and all contained (child) elements, etc.Attribute- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output styleelement-Elementto output.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input content is null
-
process
void process(SAXTarget out, Format format, List<? extends Content> list) throws JDOMException
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-SAXTargetto use.format-Formatinstance specifying output stylelist-Listof nodes.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input list is null or contains null membersClassCastException- if any of the list members are notContent
-
processAsDocument
void processAsDocument(SAXTarget out, Format format, List<? extends Content> list) throws JDOMException
This will handle printing out a list of nodes thats encapsulated in start/end Document SAX events. This can be useful for printing the content of an element that contains HTML, like "<description>JDOM is <b>fun>!</description>".- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output stylelist-Listof nodes.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input list is null or contains null membersClassCastException- if any of the list members are notContent
-
process
void process(SAXTarget out, Format format, CDATA cdata) throws JDOMException
Print out anode.CDATA- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output stylecdata-CDATAto output.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input content is null
-
process
void process(SAXTarget out, Format format, Text text) throws JDOMException
Print out anode. Perfoms the necessary entity escaping and whitespace stripping.Text- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output styletext-Textto output.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input content is null
-
process
void process(SAXTarget out, Format format, Comment comment) throws JDOMException
Print out a.Comment- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output stylecomment-Commentto output.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input content is null
-
process
void process(SAXTarget out, Format format, ProcessingInstruction pi) throws JDOMException
Print out a.ProcessingInstruction- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output stylepi-ProcessingInstructionto output.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input content is null
-
process
void process(SAXTarget out, Format format, EntityRef entity) throws JDOMException
Print out a.EntityRef- Parameters:
out-SAXTargetto use.format-Formatinstance specifying output styleentity-EntityRefto output.- Throws:
JDOMException- if there is an issue encountered during output.NullPointerException- if the input content is null
-
-