Top Description Methods
org.jdom.adapters

public Interface DOMAdapter

Known Direct Implementers
org.jdom.adapters.AbstractDOMAdapter
Imports
java.io.*, org.jdom.*, org.w3c.dom.Document

Defines a standard set of adapter methods for interfacing with a DOM parser and obtaining a DOM org.w3c.dom.Document object. Implementing classes map these calls to DOM parser-specific calls, allowing any third-party parser to be used with JDOM.
Authors
Brett McLaughlin, Jason Hunter
Version
$Revision: 1.22 $, $Date: 2007/11/10 05:28:59 $

Method Summary

Modifier and TypeMethod and Description
public Document

Returns:

Document - created DOM Document.
createDocument
()

This creates an empty Document object based on a specific parser implementation.

public Document

Returns:

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

This creates an empty Document object based on a specific parser implementation with the given DOCTYPE.

public Document

Returns:

Document - instance ready for use.
getDocument
(File
file to parse.
filename
,
boolean
boolean to indicate if validation should occur.
validate
)

This creates a new Document from a given filename by letting a DOM parser handle parsing from the file.

public Document

Returns:

Document - instance ready for use.
getDocument
(InputStream
InputStream to parse.
in
,
boolean
boolean to indicate if validation should occur.
validate
)

This creates a new Document from an existing InputStream by letting a DOM parser handle parsing using the supplied stream.

Method Detail

createDocumentback to summary
public Document createDocument() throws JDOMException

This creates an empty Document object based on a specific parser implementation.

Returns:Document

Document - created DOM Document.

Exceptions
JDOMException:
when errors occur.
createDocumentback to summary
public Document createDocument(DocType doctype) throws JDOMException

This creates an empty Document object based on a specific parser implementation with the given DOCTYPE.

Parameters
doctype:DocType

Initial DocType of the document.

Returns:Document

Document - created DOM Document.

Exceptions
JDOMException:
when errors occur.
getDocumentback to summary
public Document getDocument(File filename, boolean validate) throws IOException, JDOMException

This creates a new Document from a given filename by letting a DOM parser handle parsing from the file.

Parameters
filename:File

file to parse.

validate:boolean

boolean to indicate if validation should occur.

Returns:Document

Document - instance ready for use.

Exceptions
IOException:
when I/O error occurs.
JDOMException:
when errors occur in parsing.
getDocumentback to summary
public Document getDocument(InputStream in, boolean validate) throws IOException, JDOMException

This creates a new Document from an existing InputStream by letting a DOM parser handle parsing using the supplied stream.

Parameters
in:InputStream

InputStream to parse.

validate:boolean

boolean to indicate if validation should occur.

Returns:Document

Document - instance ready for use.

Exceptions
IOException:
when I/O error occurs.
JDOMException:
when errors occur in parsing.