org.jdom.output
Class DOMOutputter


public class DOMOutputter

Takes a JDOM tree and outputs to a DOM tree.

Author:
Brett McLaughlin, Jason Hunter, Matthew Merlo, Dan Schaffer, Yusuf Goolamabbas
Version: 1.0

Constructor Summary
DOMOutputter()
           This creates a new DOMOutputter which will attempt to first locate a DOM implementation to use via JAXP, and if JAXP does not exist or there's a problem, will fall back to the default parser.
DOMOutputter(String adapterClass)
           This creates a new DOMOutputter using the specified DOMAdapter implementation as a way to choose the underlying parser.

Method Summary
 org.w3c.dom.Documentoutput(Document document)
           This converts the JDOM Document parameter to a DOM Document, returning the DOM version.
 org.w3c.dom.Elementoutput(Element element)
           This converts the JDOM Element parameter to a DOM Element, returning the DOM version.
 org.w3c.dom.Attroutput(Attribute attribute)
           This converts the JDOM Attribute parameter to a DOM Attr, returning the DOM version.

Constructor Detail

DOMOutputter

public DOMOutputter()

This creates a new DOMOutputter which will attempt to first locate a DOM implementation to use via JAXP, and if JAXP does not exist or there's a problem, will fall back to the default parser.


DOMOutputter

public DOMOutputter(String adapterClass)

This creates a new DOMOutputter using the specified DOMAdapter implementation as a way to choose the underlying parser.

Parameters:
adapterClass - String name of class to use for DOM output
Method Detail

output

public org.w3c.dom.Document output(Document document)
throws org.jdom.JDOMException

This converts the JDOM Document parameter to a DOM Document, returning the DOM version. The DOM implementation is the one chosen in the constructor.

Parameters:
document - Document to output.
Returns: an org.w3c.dom.Document version

output

public org.w3c.dom.Element output(Element element)
throws org.jdom.JDOMException

This converts the JDOM Element parameter to a DOM Element, returning the DOM version.

Parameters:
element - Element to output.
Returns: an org.w3c.dom.Element version

output

public org.w3c.dom.Attr output(Attribute attribute)
throws org.jdom.JDOMException

This converts the JDOM Attribute parameter to a DOM Attr, returning the DOM version.

Parameters:
attribute - Attribute to output.
Returns: an org.w3c.dom.Attr version

Association Links

to Class java.lang.String

Default adapter class

to Class java.lang.String

Adapter to use for interfacing with the DOM implementation