Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jdom.output
Class DOMOutputter

    java.lang.Object
      org.jdom.output.DOMOutputter

    public class DOMOutputter

extends java.lang.Object

Outputs a JDOM `org.jdom.Document` as a DOM `org.w3c.dom.Document`.

Field Summary
`private java.lang.String` | `adapterClass` Adapter to use for interfacing with the DOM implementation
`private static java.lang.String` | `CVS_ID`
`private static java.lang.String` | `DEFAULT_ADAPTER_CLASS` Default adapter class
`private boolean` | `forceNamespaceAware` Output a DOM with namespaces but just the empty namespace

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(java.lang.String adapterClass)` This creates a new DOMOutputter using the specified DOMAdapter implementation as a way to choose the underlying parser.

Method Summary
`private org.w3c.dom.Document` | `createDOMDocument(DocType dt)`
`boolean` | `getForceNamespaceAware()` Returns whether DOMs will be constructed with namespaces even when the source document has elements all in the empty namespace.
`private static java.lang.String` | `getXmlnsTagFor(Namespace ns)` This will handle adding any ``Namespace`` attributes to the DOM tree.
`private org.w3c.dom.Attr` | `output(Attribute attribute, org.w3c.dom.Document domDoc)`
`org.w3c.dom.Document` | `output(Document document)` This converts the JDOM `Document` parameter to a DOM Document, returning the DOM version.
`private org.w3c.dom.Element` | `output(Element element, org.w3c.dom.Document domDoc, NamespaceStack namespaces)`
`void` | `setForceNamespaceAware(boolean flag)` Controls how NO_NAMESPACE nodes are handeled.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### CVS_ID

    private static final java.lang.String CVS_ID

See Also:
  Constant Field Values

### DEFAULT_ADAPTER_CLASS

    private static final java.lang.String DEFAULT_ADAPTER_CLASS

  Default adapter class

  See Also:
    Constant Field Values

### adapterClass

    private java.lang.String adapterClass

  Adapter to use for interfacing with the DOM implementation

### forceNamespaceAware

    private boolean forceNamespaceAware

  Output a DOM with namespaces but just the empty namespace

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(java.lang.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

### setForceNamespaceAware

    public void setForceNamespaceAware(boolean flag)

  Controls how NO_NAMESPACE nodes are handeled. If true the outputter always creates a namespace aware DOM.

  Parameters:
    `flag` -

### getForceNamespaceAware

    public boolean getForceNamespaceAware()

  Returns whether DOMs will be constructed with namespaces even when the source document has elements all in the empty namespace.

  Returns:
    the forceNamespaceAware flag value

### 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 DOM implementation is the one chosen in the constructor.

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

### createDOMDocument

    private org.w3c.dom.Document createDOMDocument(DocType dt)
                                            throws JDOMException

  Throws:
    `JDOMException`

### output

    private org.w3c.dom.Element output(Element element,
                                       org.w3c.dom.Document domDoc,
                                       NamespaceStack namespaces)
                                throws JDOMException

  Throws:
    `JDOMException`

### output

    private org.w3c.dom.Attr output(Attribute attribute,
                                    org.w3c.dom.Document domDoc)
                             throws JDOMException

  Throws:
    `JDOMException`

### getXmlnsTagFor

    private static java.lang.String getXmlnsTagFor(Namespace ns)

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

  Parameters:
    `ns` - `Namespace` to add definition of

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD