Top Description Methods
org.jdom2.output.support

public Interface DOMOutputProcessor

Known Direct Implementers
org.jdom2.output.support.AbstractDOMOutputProcessor
Imports
java.util.List, org.jdom2.Attribute, .CDATA, .Comment, .Content, .Document, .Element, .EntityRef, .ProcessingInstruction, .Text, org.jdom2.output.DOMOutputter, .Format

This interface provides a base support for the DOMOutputter.

People who want to create a custom DOMOutputProcessor for DOMOutputter are able to implement this interface with the following notes and restrictions:

  1. The DOMOutputter will call one, and only one of the process(Format,*) methods each time the DOMOutputter is requested to output some JDOM content. It is thus safe to assume that a process(Format,*) method can set up any infrastructure needed to process the content, and that the DOMOutputter will not re-call that method, or some other process(Format,*) method for the same output sequence.
  2. The process methods should be thread-safe and reentrant: The same process(Format,*) method may (will) be called concurrently from different threads.

The AbstractDOMOutputProcessor class is a full implementation of this interface and is fully customisable. People who want a custom DOMOutputter are encouraged to extend the AbstractDOMOutputProcessor rather than do a full re-implementation of this interface.

Author
Rolf Lear
Since
JDOM2
See Also
DOMOutputter, AbstractDOMOutputProcessor

Method Summary

Modifier and TypeMethod and Description
public Document

Returns:

The same DOM Document as the input document, but with the JDOM content converted and added.
process
(Document
The DOM document to use for the conversion
basedoc
,
Format
Format instance specifying output style
format
,
Document
Document to format.
doc
)

This will convert the Document to the given DOM Document.

public Element

Returns:

The input JDOM Element converted to a DOM Element
process
(Document
The DOM document to use for the conversion
basedoc
,
Format
Format instance specifying output style
format
,
Element
Element to format.
element
)

This will convert the Element using the given DOM Document to create the resulting DOM Element.

public List<Node>

Returns:

The input JDOM Content List converted to a List of DOM Nodes
process
(Document
The DOM document to use for the conversion
basedoc
,
Format
Format instance specifying output style
format
,
List<? extends Content>
JDOM Content to convert.
list
)

This will convert the list of JDOM Content using the given DOM Document to create the resulting list of DOM Nodes.

public CDATASection

Returns:

The input JDOM CDATA converted to a DOM CDATASection
process
(Document
The DOM document to use for the conversion
basedoc
,
Format
Format instance specifying output style
format
,
CDATA
CDATA to format.
cdata
)

This will convert the CDATA using the given DOM Document to create the resulting DOM CDATASection.

public Text

Returns:

The input JDOM Text converted to a DOM Text
process
(Document
The DOM document to use for the conversion
basedoc
,
Format
Format instance specifying output style
format
,
Text
Text to format.
text
)

This will convert the Text using the given DOM Document to create the resulting DOM Text.

public Comment

Returns:

The input JDOM Comment converted to a DOM Comment
process
(Document
The DOM document to use for the conversion
basedoc
,
Format
Format instance specifying output style
format
,
Comment
Comment to format.
comment
)

This will convert the Comment using the given DOM Document to create the resulting DOM Comment.

public ProcessingInstruction

Returns:

The input JDOM ProcessingInstruction converted to a DOM ProcessingInstruction
process
(Document
The DOM document to use for the conversion
basedoc
,
Format
Format instance specifying output style
format
,
ProcessingInstruction
ProcessingInstruction to format.
pi
)

This will convert the ProcessingInstruction using the given DOM Document to create the resulting DOM ProcessingInstruction.

public EntityReference

Returns:

The input JDOM EntityRef converted to a DOM EntityReference
process
(Document
The DOM document to use for the conversion
basedoc
,
Format
Format instance specifying output style
format
,
EntityRef
EntityRef to format.
entity
)

This will convert the EntityRef using the given DOM Document to create the resulting DOM EntityReference.

public Attr

Returns:

The input JDOM Attribute converted to a DOM Attr
process
(Document
The DOM document to use for the conversion
basedoc
,
Format
Format instance specifying output style
format
,
Attribute
Attribute to format.
attribute
)

This will convert the Attribute using the given DOM Document to create the resulting DOM Attr.

Method Detail

processback to summary
public Document process(Document basedoc, Format format, Document doc)

This will convert the Document to the given DOM Document.

Parameters
basedoc:Document

The DOM document to use for the conversion

format:Format

Format instance specifying output style

doc:Document

Document to format.

Returns:Document

The same DOM Document as the input document, but with the JDOM content converted and added.

processback to summary
public Element process(Document basedoc, Format format, Element element)

This will convert the Element using the given DOM Document to create the resulting DOM Element.

Parameters
basedoc:Document

The DOM document to use for the conversion

format:Format

Format instance specifying output style

element:Element

Element to format.

Returns:Element

The input JDOM Element converted to a DOM Element

processback to summary
public List<Node> process(Document basedoc, Format format, List<? extends Content> list)

This will convert the list of JDOM Content using the given DOM Document to create the resulting list of DOM Nodes.

Parameters
basedoc:Document

The DOM document to use for the conversion

format:Format

Format instance specifying output style

list:List<? extends Content>

JDOM Content to convert.

Returns:List<Node>

The input JDOM Content List converted to a List of DOM Nodes

processback to summary
public CDATASection process(Document basedoc, Format format, CDATA cdata)

This will convert the CDATA using the given DOM Document to create the resulting DOM CDATASection.

Parameters
basedoc:Document

The DOM document to use for the conversion

format:Format

Format instance specifying output style

cdata:CDATA

CDATA to format.

Returns:CDATASection

The input JDOM CDATA converted to a DOM CDATASection

processback to summary
public Text process(Document basedoc, Format format, Text text)

This will convert the Text using the given DOM Document to create the resulting DOM Text.

Parameters
basedoc:Document

The DOM document to use for the conversion

format:Format

Format instance specifying output style

text:Text

Text to format.

Returns:Text

The input JDOM Text converted to a DOM Text

processback to summary
public Comment process(Document basedoc, Format format, Comment comment)

This will convert the Comment using the given DOM Document to create the resulting DOM Comment.

Parameters
basedoc:Document

The DOM document to use for the conversion

format:Format

Format instance specifying output style

comment:Comment

Comment to format.

Returns:Comment

The input JDOM Comment converted to a DOM Comment

processback to summary
public ProcessingInstruction process(Document basedoc, Format format, ProcessingInstruction pi)

This will convert the ProcessingInstruction using the given DOM Document to create the resulting DOM ProcessingInstruction.

Parameters
basedoc:Document

The DOM document to use for the conversion

format:Format

Format instance specifying output style

pi:ProcessingInstruction

ProcessingInstruction to format.

Returns:ProcessingInstruction

The input JDOM ProcessingInstruction converted to a DOM ProcessingInstruction

processback to summary
public EntityReference process(Document basedoc, Format format, EntityRef entity)

This will convert the EntityRef using the given DOM Document to create the resulting DOM EntityReference.

Parameters
basedoc:Document

The DOM document to use for the conversion

format:Format

Format instance specifying output style

entity:EntityRef

EntityRef to format.

Returns:EntityReference

The input JDOM EntityRef converted to a DOM EntityReference

processback to summary
public Attr process(Document basedoc, Format format, Attribute attribute)

This will convert the Attribute using the given DOM Document to create the resulting DOM Attr.

Parameters
basedoc:Document

The DOM document to use for the conversion

format:Format

Format instance specifying output style

attribute:Attribute

Attribute to format.

Returns:Attr

The input JDOM Attribute converted to a DOM Attr