org.jdom2.Document as a DOM
org.w3c.dom.Document . Also provides methods to
output other types of JDOM Content in the equivalent DOM nodes.
There are two versions of most functions, one that creates an independent DOM node using the DOMAdapter to create a new org.w3c.dom.Document. The other version creates the new DOM Nodes using the supplied org.w3c.dom.Document instance.
| Modifier and Type | Class and Description |
|---|---|
| private static class | DOMOutputter.DefaultDOMOutputProcessor
Create a final/concrete instance of the AbstractDOMOutputProcessor. |
| Modifier and Type | Field and Description |
|---|---|
| private DOMAdapter | adapter
Adapter to use for interfacing with the DOM implementation |
| private static final DOMAdapter | DEFAULT_ADAPTER
Default adapter class |
| private static final DOMOutputProcessor | |
| private Format | |
| private DOMOutputProcessor |
| Access | Constructor and Description |
|---|---|
| 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. |
| public | DOMOutputter(DOMOutputProcessor
the custom processor to use. processor)This creates a new DOMOutputter which uses the default (JAXP) DOM implementation but with a custom processor. |
| public | DOMOutputter(DOMAdapter
The adapter to use to create the base Document instance (null
implies the default). adapter, Format The output Format to use (null implies the default). format, DOMOutputProcessor The custom mechanism for doing the output (null implies the
default). processor)The complete constructor for specifying a custom DOMAdaptor, Format, and DOMOutputProcessor. |
| public | DOMOutputter(String
String name of class to use for DOM output
Deprecated
use
This creates a new DOMOutputter using the specified DOMAdapter
implementation as a way to choose the underlying parser.
DOMOutputter#DOMOutputter(DOMAdapter) instead.
|
| public | DOMOutputter(DOMAdapter
the DOMAdapter instance to use for creating the base
org.w3c.dom.Document Specify the null value to get the default
adapter. adapter)This creates a new DOMOutputter using the specified DOMAdapter implementation as a way to choose the underlying parser. |
| Modifier and Type | Method and Description |
|---|---|
| public DOMAdapter | Returns: the current DOMAdapter.Get the DOMAdapter currently set for this DOMOutputter. |
| public DOMOutputProcessor | |
| public boolean | Returns: the forceNamespaceAware flag value
Deprecated
All DOMOutputters are always NamesapceAware. Always true.
Returns whether DOMs will be constructed with namespaces even when the
source document has elements all in the empty namespace.
|
| public Format | Returns: the current Format instanceGet the Format instance currently used by this DOMOutputter. |
| public Document | |
| public DocumentType | |
| public Element | |
| public Text | |
| public CDATASection | |
| public ProcessingInstruction | Returns: anorg.w3c.dom.Element versionProcessingInstruction to output.This converts the JDOM |
| public Comment | |
| public EntityReference | |
| public Attr | |
| public List | |
| public Element | |
| public Text | |
| public CDATASection | |
| public ProcessingInstruction | Returns: anorg.w3c.dom.Element versionThe DOM Document to use for creating DOM Nodes. basedoc, ProcessingInstruction ProcessingInstruction to output.This converts the JDOM |
| public Comment | |
| public EntityReference | |
| public Attr | |
| public List | |
| public void | setDOMAdapter(DOMAdapter
the new DOMAdapter to use (null implies the default). adapter)Set the DOMAdapter currently set for this DOMOutputter. |
| public void | setDOMOutputProcessor(DOMOutputProcessor
the new processor to set (null implies the default) processor)Set a new DOMOutputProcessor for this DOMOutputter. |
| public void | setForceNamespaceAware(boolean
true to force NamespaceAware flag)
Deprecated
All DOMOutputters are now always NamespaceAware.
Controls how NO_NAMESPACE nodes are handled.
|
| public void |
| adapter | back to summary |
|---|---|
| private DOMAdapter adapter Adapter to use for interfacing with the DOM implementation | |
| DEFAULT_ADAPTER | back to summary |
|---|---|
| private static final DOMAdapter DEFAULT_ADAPTER Default adapter class | |
| DEFAULT_PROCESSOR | back to summary |
|---|---|
| private static final DOMOutputProcessor DEFAULT_PROCESSOR | |
| format | back to summary |
|---|---|
| private Format format | |
| processor | back to summary |
|---|---|
| private DOMOutputProcessor processor | |
| DOMOutputter | back to summary |
|---|---|
| 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 | back to summary |
|---|---|
| public DOMOutputter(DOMOutputProcessor processor) This creates a new DOMOutputter which uses the default (JAXP) DOM implementation but with a custom processor.
| |
| DOMOutputter | back to summary |
|---|---|
| public DOMOutputter(DOMAdapter adapter, Format format, DOMOutputProcessor processor) The complete constructor for specifying a custom DOMAdaptor, Format, and DOMOutputProcessor.
| |
| DOMOutputter | back to summary |
|---|---|
| public DOMOutputter(String adapterClass)
Deprecated use This creates a new DOMOutputter using the specified DOMAdapter implementation as a way to choose the underlying parser.
| |
| DOMOutputter | back to summary |
|---|---|
| public DOMOutputter(DOMAdapter adapter) This creates a new DOMOutputter using the specified DOMAdapter implementation as a way to choose the underlying parser.
If the specified adapter is not thread-safe then the user should ensure
that the adapter instance is never shared between multiple DOMOutputters.
The default DOMAdapter
| |
| getDOMAdapter | back to summary |
|---|---|
| public DOMAdapter getDOMAdapter() Get the DOMAdapter currently set for this DOMOutputter.
| |
| getDOMOutputProcessor | back to summary |
|---|---|
| public DOMOutputProcessor getDOMOutputProcessor() Get the current DOMOutputProcessor
| |
| getForceNamespaceAware | back to summary |
|---|---|
| public boolean getForceNamespaceAware()
Deprecated All DOMOutputters are always NamesapceAware. Always true. Returns whether DOMs will be constructed with namespaces even when the source document has elements all in the empty namespace.
| |
| getFormat | back to summary |
|---|---|
| public Format getFormat() Get the Format instance currently used by this DOMOutputter.
| |
| output | back to summary |
|---|---|
| public Document output(Document document) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public DocumentType output(DocType doctype) throws JDOMException This converts the JDOM Unlike the other DOM Nodes, you cannot use a DOM Document to simply create a DOM DocumentType Node, it has to be created at the same time as the DOM Document instance. As a result, there is no version of this method that takes a DOM Document instance.
| |
| output | back to summary |
|---|---|
| public Element output(Element element) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public Text output(Text text) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public CDATASection output(CDATA cdata) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public ProcessingInstruction output(ProcessingInstruction pi) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public Comment output(Comment comment) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public EntityReference output(EntityRef entity) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public Attr output(Attribute attribute) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public List This converts the JDOM
| |
| output | back to summary |
|---|---|
| public Element output(Document basedoc, Element element) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public Text output(Document basedoc, Text text) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public CDATASection output(Document basedoc, CDATA cdata) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public ProcessingInstruction output(Document basedoc, ProcessingInstruction pi) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public Comment output(Document basedoc, Comment comment) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public EntityReference output(Document basedoc, EntityRef entity) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public Attr output(Document basedoc, Attribute attribute) throws JDOMException This converts the JDOM
| |
| output | back to summary |
|---|---|
| public List This converts the list of JDOM | |
| setDOMAdapter | back to summary |
|---|---|
| public void setDOMAdapter(DOMAdapter adapter) Set the DOMAdapter currently set for this DOMOutputter.
| |
| setDOMOutputProcessor | back to summary |
|---|---|
| public void setDOMOutputProcessor(DOMOutputProcessor processor) Set a new DOMOutputProcessor for this DOMOutputter.
| |
| setForceNamespaceAware | back to summary |
|---|---|
| public void setForceNamespaceAware(boolean flag)
Deprecated All DOMOutputters are now always NamespaceAware. Controls how NO_NAMESPACE nodes are handled. If true the outputter always creates a namespace aware DOM.
| |
| setFormat | back to summary |
|---|---|
| public void setFormat(Format format) Set a new Format instance for this DOMOutputter
| |
| Access | Constructor and Description |
|---|---|
| private |
| DefaultDOMOutputProcessor | back to summary |
|---|---|
| private DefaultDOMOutputProcessor() | |