Package org.jdom.output.support
Interface XMLOutputProcessor
-
- All Known Implementing Classes:
AbstractXMLOutputProcessor
public interface XMLOutputProcessorThis interface provides a base support for theXMLOutputter2.People who want to create a custom XMLOutputProcessor for XMLOutputter are able to implement this interface with the following notes and restrictions:
- The XMLOutputter will call one, and only one of the
process(Writer,Format,*)methods each time the XMLOutputter is requested to output some JDOM content. It is thus safe to assume that aprocess(Writer,Format,*)method can set up any infrastructure needed to process the content, and that the XMLOutputter will not re-call that method, or some otherprocess(Writer,Format,*)method for the same output sequence. - The process methods should be thread-safe and reentrant: The same
process(Writer,Format,*)method may (will) be called concurrently from different threads.
The
AbstractXMLOutputProcessorclass 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.- Since:
- JDOM2
- See Also:
XMLOutputter2,AbstractXMLOutputProcessor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidprocess(Writer out, Format format, List<? extends Content> list)This will handle printing out a list of nodes.voidprocess(Writer out, Format format, CDATA cdata)Print out anode.CDATAvoidprocess(Writer out, Format format, Comment comment)Print out a.Commentvoidprocess(Writer out, Format format, DocType doctype)Print out the.DocTypevoidprocess(Writer out, Format format, Document doc)This will print theto the given Writer.Documentvoidprocess(Writer out, Format format, Element element)voidprocess(Writer out, Format format, EntityRef entity)Print out a.EntityRefvoidprocess(Writer out, Format format, ProcessingInstruction pi)Print out a.ProcessingInstructionvoidprocess(Writer out, Format format, Text text)Print out anode.Text
-
-
-
Method Detail
-
process
void process(Writer out, Format format, Document doc) throws IOException
This will print theto the given Writer.DocumentWarning: using your own Writer 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-Writerto use.format-Formatinstance specifying output styledoc-Documentto format.- Throws:
IOException- if there's any problem writing.NullPointerException- if the input content is null
-
process
void process(Writer out, Format format, DocType doctype) throws IOException
Print out the.DocType- Parameters:
out-Writerto use.format-Formatinstance specifying output styledoctype-DocTypeto output.- Throws:
IOException- if there's any problem writing.NullPointerException- if the input content is null
-
process
void process(Writer out, Format format, Element element) throws IOException
- Parameters:
out-Writerto use.format-Formatinstance specifying output styleelement-Elementto output.- Throws:
IOException- if there's any problem writing.NullPointerException- if the input content is null
-
process
void process(Writer out, Format format, List<? extends Content> list) throws IOException
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-Writerto use.format-Formatinstance specifying output stylelist-Listof nodes.- Throws:
IOException- 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
void process(Writer out, Format format, CDATA cdata) throws IOException
Print out anode.CDATA- Parameters:
out-Writerto use.format-Formatinstance specifying output stylecdata-CDATAto output.- Throws:
IOException- if there's any problem writing.NullPointerException- if the input content is null
-
process
void process(Writer out, Format format, Text text) throws IOException
Print out anode. Perfoms the necessary entity escaping and whitespace stripping.Text- Parameters:
out-Writerto use.format-Formatinstance specifying output styletext-Textto output.- Throws:
IOException- if there's any problem writing.NullPointerException- if the input content is null
-
process
void process(Writer out, Format format, Comment comment) throws IOException
Print out a.Comment- Parameters:
out-Writerto use.format-Formatinstance specifying output stylecomment-Commentto output.- Throws:
IOException- if there's any problem writing.NullPointerException- if the input content is null
-
process
void process(Writer out, Format format, ProcessingInstruction pi) throws IOException
Print out a.ProcessingInstruction- Parameters:
out-Writerto use.format-Formatinstance specifying output stylepi-ProcessingInstructionto output.- Throws:
IOException- if there's any problem writing.NullPointerException- if the input content is null
-
process
void process(Writer out, Format format, EntityRef entity) throws IOException
Print out a.EntityRef- Parameters:
out-Writerto use.format-Formatinstance specifying output styleentity-EntityRefto output.- Throws:
IOException- if there's any problem writing.NullPointerException- if the input content is null
-
-