org.jdom.output
Class DOMOutputter

java.lang.Object
  |
  +--org.jdom.output.DOMOutputter

public class DOMOutputter
extends java.lang.Object

Takes a JDOM tree and outputs to a DOM tree.

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

Constructor Summary
DOMOutputter()
           This creates a DOMOutputter.
 
Method Summary
protected  void buildDOMTree(java.lang.Object content, org.w3c.dom.Document doc, org.w3c.dom.Element current, boolean atRoot, java.util.LinkedList namespaces)
           This takes a JDOM Object and builds up a DOM tree, recursing until the JDOM tree is exhausted and the DOM tree results.
 java.lang.String getXmlnsTagFor(Namespace ns)
           This will handle adding any Namespace attributes to the DOM tree.
 org.w3c.dom.Attr output(Attribute attribute)
           This converts the JDOM Attribute parameter to a DOM Attr, returning the DOM version.
 org.w3c.dom.Attr output(Attribute attribute, java.lang.String domAdapterClass)
           This converts the JDOM Attribute parameter to a DOM Attr, returning the DOM version.
 org.w3c.dom.Document output(Document document)
           This converts the JDOM Document parameter to a DOM Document, returning the DOM version.
 org.w3c.dom.Document output(Document document, java.lang.String domAdapterClass)
           This converts the JDOM Document parameter to a DOM Document, returning the DOM version.
 org.w3c.dom.Element output(Element element)
           This converts the JDOM Element parameter to a DOM Element, returning the DOM version.
 org.w3c.dom.Element output(Element element, java.lang.String domAdapterClass)
           This converts the JDOM Element parameter to a DOM Element, returning the DOM version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMOutputter

public DOMOutputter()

This creates a DOMOutputter.

Method Detail

output

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

This converts the JDOM Document parameter to a DOM Document, returning the DOM version. The default DOM adapter class is used.

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

output

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

This converts the JDOM Element parameter to a DOM Element, returning the DOM version. The default DOM adapter class is used.

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

output

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

This converts the JDOM Attribute parameter to a DOM Attr, returning the DOM version. The default DOM adapter class is used.

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

output

public org.w3c.dom.Element output(Element element,
                                  java.lang.String domAdapterClass)
                           throws JDOMException

This converts the JDOM Element parameter to a DOM Element, returning the DOM version. The specified DOM adapter class (see org.jdom.adapters.*) is used, as a way to choose the DOM implementation.

Parameters:
element - Element to output.
domAdapterClass - DOM adapter class to use
Returns:
an org.w3c.dom.Element version

output

public org.w3c.dom.Document output(Document document,
                                   java.lang.String domAdapterClass)
                            throws JDOMException

This converts the JDOM Document parameter to a DOM Document, returning the DOM version. The specified DOM adapter class (see org.jdom.adapters.*) is used, as a way to choose the DOM implementation.

Parameters:
document - Document to output.
domAdapterClass - DOM adapter class to use
Returns:
an org.w3c.dom.Document version

output

public org.w3c.dom.Attr output(Attribute attribute,
                               java.lang.String domAdapterClass)
                        throws JDOMException

This converts the JDOM Attribute parameter to a DOM Attr, returning the DOM version. The specified DOM adapter class (see org.jdom.adapters.*) is used, as a way to choose the DOM implementation

Parameters:
attribute - Attribute to output.
domAdapterClass - DOM adapter class to use
Returns:
an org.w3c.dom.Attr version

buildDOMTree

protected void buildDOMTree(java.lang.Object content,
                            org.w3c.dom.Document doc,
                            org.w3c.dom.Element current,
                            boolean atRoot,
                            java.util.LinkedList namespaces)

This takes a JDOM Object and builds up a DOM tree, recursing until the JDOM tree is exhausted and the DOM tree results.

Parameters:
content - Object to examine.
doc - DOM Document being built.
current - Element that is current parent.
atRoot - boolean indicating whether at root level.
namespaces - LinkedList containing namespaces in scope

getXmlnsTagFor

public java.lang.String getXmlnsTagFor(Namespace ns)

This will handle adding any Namespace attributes to the DOM tree.

Parameters:
ns - Namespace to add definition of


Copyright © 2000 Brett McLaughlin, Jason Hunter. All Rights Reserved.