Interface DOMAdapter
- All Known Implementing Classes:
AbstractDOMAdapter
,JAXPDOMAdapter
org.w3c.dom.Document
object.
Instances of this interface are used by the DOMOutputter
class to
create a DOM output result using the org.w3c.dom.Document implementation
returned by these methods.
You should never need to implement this interface unless you have a specific need to use something other than the default JAXP-based mechanism.
JDOM only provides one 'concrete' implementation of the DOMAdapter: the
JAXPDOMAdapter
class. That implementation is a thread-safe and
efficient implementation. It can be used as a template for building your own
custom DOMAdapter implementation, if you need it.
The AbstractDOMAdapter
class could help you by implementing the
DocType-based method which leverages the base createDocument() method.
Special note for implementation of DOMAdapter: For backward compatibility with JDOM 1.x (which allows a class-name to be used to specify a DOMAdapter in the DOMOoutputter class), it is required that your implementations of DOMAdapter have a no-argument default constructor. If you require a constructor argument then you have to ensure that you use the correct (non-deprecated) mechanisms on DOMOutputter to specify your custom DOMAdapter.
- Author:
- Brett McLaughlin, Jason Hunter
-
Method Summary
Modifier and TypeMethodDescriptionThis creates an emptyDocument
object based on a specific parser implementation.createDocument
(DocType doctype) This creates an emptyDocument
object based on a specific parser implementation with the given DOCTYPE.
-
Method Details
-
createDocument
This creates an emptyDocument
object based on a specific parser implementation.- Returns:
Document
- created DOM Document.- Throws:
JDOMException
- if an error occurs.
-
createDocument
This creates an emptyDocument
object based on a specific parser implementation with the given DOCTYPE.- Parameters:
doctype
- InitialDocType
of the document.- Returns:
Document
- created DOM Document.- Throws:
JDOMException
- if an error occurs.
-