Top Description Constructors Methods
org.jdom2.adapters

public abstract Class AbstractDOMAdapter

extends Object
implements DOMAdapter
Class Inheritance
All Implemented Interfaces
org.jdom2.adapters.DOMAdapter
Known Direct Subclasses
org.jdom2.adapters.JAXPDOMAdapter
Imports
java.lang.reflect.InvocationTargetException, .Method, org.jdom2.DocType, .JDOMException, org.w3c.dom.DOMImplementation, .Document, .DocumentType, .Element

A DOMAdapter utility abstract base class. Uses the concrete implementation to build a org.w3c.dom.Document instance, which in turn is used to apply the DocType.

Special attention should be paid to the setInternalSubset protected method, which may, or may not be supported by your actual DOM implementation.

Authors
Brett McLaughlin, Jason Hunter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Document

Returns:

Document - created DOM Document.
createDocument
(DocType
Initial DocType of the document.
doctype
)

Implements org.jdom2.adapters.DOMAdapter.createDocument.

This creates an empty Document object based on a specific parser implementation with the given DOCTYPE.
protected void
setInternalSubset(DocumentType
DocumentType to be altered
dt
,
String
String to use as the internal DTD subset
s
)

This attempts to change the DocumentType to have the given internal DTD subset value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AbstractDOMAdapterback to summary
public AbstractDOMAdapter()

Method Detail

createDocumentback to summary
public Document createDocument(DocType doctype) throws JDOMException

Implements org.jdom2.adapters.DOMAdapter.createDocument.

This creates an empty Document object based on a specific parser implementation with the given DOCTYPE. If the doctype parameter is null, the behavior is the same as calling createDocument().

Parameters
doctype:DocType

Initial DocType of the document.

Returns:Document

Document - created DOM Document.

Annotations
@Override
Exceptions
JDOMException:
when errors occur.
setInternalSubsetback to summary
protected void setInternalSubset(DocumentType dt, String s)

This attempts to change the DocumentType to have the given internal DTD subset value. This is not a standard ability in DOM, so it's only available with some parsers. Subclasses can alter the mechanism by which the attempt is made to set the value.

Parameters
dt:DocumentType

DocumentType to be altered

s:String

String to use as the internal DTD subset