DOMOutputProcessor
for supporting the DOMOutputter.
This class is marked abstract even though all methods are fully implemented.
The process*(...) methods are public because they match the
DOMOutputProcessor interface but the remaining methods are all protected.
People who want to create a custom DOMOutputProcessor for DOMOutputter
are able to extend this class and modify any functionality they want. Before
sub-classing this you should first check to see if the Format class
can get you the results you want.
Subclasses of this should have reentrant methods. This is easiest to accomplish simply by not allowing any instance fields. If your sub-class has an instance field/variable, then it's probably broken.
One significant feature of this implementation is that it creates and
maintains both a NamespaceStack and FormatStack that are
managed in the
printElement(FormatStack, NamespaceStack, org.
method. The stacks are pushed and popped in that method only. They
significantly improve the performance and readability of the code.
The NamespaceStack is only sent through to the
printElement(FormatStack, NamespaceStack, org.
and
printContent(FormatStack, NamespaceStack, org.
methods, but the FormatStack is pushed through to all print* Methods.
This class delegates the formatting of the content to the Walker classes
and you can create your own custom walker by overriding the
buildWalker(FormatStack, List, boolean) method.
DOMOutputter, DOMOutputProcessor
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static String | getXmlnsTagFor(Namespace
Namespace to add definition ofThis will handle adding any |
| protected Node | Returns: the input JDOM Content converted to a DOM Node.The current FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final Content The content to dispatch content)This method contains code which is reused in a number of places. |
| protected Attr | Returns: The input JDOM Attribute converted to a DOM Attrthe FormatStack fstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final Attribute Attribute to write.This will handle printing of a |
| protected CDATASection | Returns: The input JDOM CDATA converted to a DOM CDATASectionthe FormatStack fstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final CDATA CDATA to write.This will handle printing of a |
| protected Comment | Returns: The input JDOM Comment converted to a DOM Commentthe FormatStack fstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final Comment Comment to write.This will handle printing of a |
| protected void | printContent(final FormatStack
the FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final Node the DOM node this content should be appended to. target, final Walker List of Content to write.This will handle printing of a List of |
| protected Document | Returns: The input JDOM document converted to a DOM document.the FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final Document Document to write.This will handle printing of a |
| protected Element | Returns: The input JDOM Element converted to a DOM Elementthe FormatStack fstack, final NamespaceStack the NamespaceStack nstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final Element Element to write.This will handle printing of an |
| protected EntityReference | Returns: The input JDOM EntityRef converted to a DOM EntityReferencethe FormatStack fstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final EntityRef EntotyRef to write.This will handle printing of an |
| protected ProcessingInstruction | Returns: The input JDOM ProcessingInstruction converted to a DOM ProcessingInstruction.the FormatStack fstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final ProcessingInstruction ProcessingInstruction to write.This will handle printing of a |
| protected Text | Returns: The input JDOM Text converted to a DOM Textthe FormatStack fstack, final Document The org.w3c.dom.Document for creating DOM Nodes basedoc, final Text Text to write.This will handle printing of a |
| public Document | |
| public Element | process(Document
The DOM document to use for the conversion basedoc, Format Format instance specifying output styleElement to format.Implements org. using the given DOM
Document to create the resulting DOM Element.
|
| public List | process(Document
The DOM document to use for the conversion basedoc, Format Format instance specifying output styleJDOM list)Content to convert.Implements org. using the
given DOM Document to create the resulting list of DOM Nodes.
|
| public CDATASection | process(Document
The DOM document to use for the conversion basedoc, Format Format instance specifying output styleCDATA to format.Implements org. using the given DOM
Document to create the resulting DOM CDATASection.
|
| public Text | process(Document
The DOM document to use for the conversion basedoc, Format Format instance specifying output styleText to format.Implements org. using the given DOM
Document to create the resulting DOM Text.
|
| public Comment | process(Document
The DOM document to use for the conversion basedoc, Format Format instance specifying output styleComment to format.Implements org. using the given DOM
Document to create the resulting DOM Comment.
|
| public ProcessingInstruction | process(Document
The DOM document to use for the conversion basedoc, Format Format instance specifying output styleProcessingInstruction to format.Implements org. using
the given DOM Document to create the resulting DOM ProcessingInstruction.
|
| public EntityReference | process(Document
The DOM document to use for the conversion basedoc, Format Format instance specifying output styleEntityRef to format.Implements org. using the given DOM
Document to create the resulting DOM EntityReference.
|
| public Attr | process(Document
The DOM document to use for the conversion basedoc, Format Format instance specifying output styleAttribute to format.Implements org. using the given DOM
Document to create the resulting DOM Attr.
|
| AbstractDOMOutputProcessor | back to summary |
|---|---|
| public AbstractDOMOutputProcessor() | |
| getXmlnsTagFor | back to summary |
|---|---|
| private static String getXmlnsTagFor(Namespace ns) This will handle adding any
| |
| helperContentDispatcher | back to summary |
|---|---|
| protected Node helperContentDispatcher(final FormatStack fstack, final NamespaceStack nstack, final Document basedoc, final Content content) This method contains code which is reused in a number of places. It simply determines what content is passed in, and dispatches it to the correct print* method.
| |
| printAttribute | back to summary |
|---|---|
| protected Attr printAttribute(final FormatStack fstack, final Document basedoc, final Attribute attribute) This will handle printing of a
| |
| printCDATA | back to summary |
|---|---|
| protected CDATASection printCDATA(final FormatStack fstack, final Document basedoc, final CDATA cdata) This will handle printing of a
| |
| printComment | back to summary |
|---|---|
| protected Comment printComment(final FormatStack fstack, final Document basedoc, final Comment comment) This will handle printing of a
| |
| printContent | back to summary |
|---|---|
| protected void printContent(final FormatStack fstack, final NamespaceStack nstack, final Document basedoc, final Node target, final Walker walker) This will handle printing of a List of
| |
| printDocument | back to summary |
|---|---|
| protected Document printDocument(final FormatStack fstack, final NamespaceStack nstack, final Document basedoc, final Document doc) This will handle printing of a
| |
| printElement | back to summary |
|---|---|
| protected Element printElement(final FormatStack fstack, final NamespaceStack nstack, final Document basedoc, final Element element) This will handle printing of an This method arranges for outputting the Element infrastructure including Namespace Declarations and Attributes. The actual formatting of the content is managed by the Walker created for the Element's content.
| |
| printEntityRef | back to summary |
|---|---|
| protected EntityReference printEntityRef(final FormatStack fstack, final Document basedoc, final EntityRef entity) This will handle printing of an
| |
| printProcessingInstruction | back to summary |
|---|---|
| protected ProcessingInstruction printProcessingInstruction(final FormatStack fstack, final Document basedoc, final ProcessingInstruction pi) This will handle printing of a
| |
| printText | back to summary |
|---|---|
| protected Text printText(final FormatStack fstack, final Document basedoc, final Text text) This will handle printing of a
| |
| process | back to summary |
|---|---|
| public Document process(Document basedoc, Format format, Document doc) Implements org. Doc from org. This will convert the
| |
| process | back to summary |
|---|---|
| public Element process(Document basedoc, Format format, Element element) Implements org. Doc from org. This will convert the | |
| process | back to summary |
|---|---|
| public List Implements org. Doc from org. This will convert the list of JDOM | |
| process | back to summary |
|---|---|
| public CDATASection process(Document basedoc, Format format, CDATA cdata) Implements org. Doc from org. This will convert the
| |
| process | back to summary |
|---|---|
| public Text process(Document basedoc, Format format, Text text) Implements org. Doc from org. This will convert the | |
| process | back to summary |
|---|---|
| public Comment process(Document basedoc, Format format, Comment comment) Implements org. Doc from org. This will convert the | |
| process | back to summary |
|---|---|
| public ProcessingInstruction process(Document basedoc, Format format, ProcessingInstruction pi) Implements org. Doc from org. This will convert the
| |
| process | back to summary |
|---|---|
| public EntityReference process(Document basedoc, Format format, EntityRef entity) Implements org. Doc from org. This will convert the
| |
| process | back to summary |
|---|---|
| public Attr process(Document basedoc, Format format, Attribute attribute) Implements org. Doc from org. This will convert the | |