Top Description Fields Constructors Methods
org.jdom.input

public Class DOMBuilder

extends Object
Class Inheritance
Imports
java.util.HashSet, .Iterator, org.jdom.*, .Document, .Element, org.w3c.dom.*

Builds a JDOM org.jdom.Document from a pre-existing DOM org.w3c.dom.Document. Also handy for testing builds from files to sanity check SAXBuilder.
Authors
Brett McLaughlin, Jason Hunter, Philip Nelson, Kevin Regan, Yusuf Goolamabbas, Dan Schaffer, Bradley S. Huffman
Version
$Revision: 1.60 $, $Date: 2007/11/10 05:29:00 $

Field Summary

Modifier and TypeField and Description
private String
adapterClass

Adapter class to use

private static final String
private JDOMFactory
factory

The factory for creating new JDOM objects

Constructor Summary

AccessConstructor and Description
public
DOMBuilder()

This creates a new DOMBuilder which will attempt to first locate a parser via JAXP, then will try to use a set of default parsers.

public
DOMBuilder(String
String name of class to use for DOM building.
adapterClass
)

This creates a new DOMBuilder using the specified DOMAdapter implementation as a way to choose the underlying parser.

Method Summary

Modifier and TypeMethod and Description
public Document

Returns:

Document - JDOM document object.
build
(Document
org.w3c.dom.Document object
domDocument
)

This will build a JDOM tree from an existing DOM tree.

public Element

Returns:

Element - JDOM Element object
build
(Element
org.w3c.dom.Element object
domElement
)

This will build a JDOM Element from an existing DOM Element

private void
buildTree(Node
Code to examine.
node
,
Document
JDOM Document being built.
doc
,
Element
Element that is current parent.
current
,
boolean
boolean indicating whether at root level.
atRoot
)

This takes a DOM Node and builds up a JDOM tree, recursing until the DOM tree is exhausted and the JDOM tree results.

public JDOMFactory

Returns:

the factory in use
getFactory
()

Returns the current org.jdom.JDOMFactory in use.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

adapterClassback to summary
private String adapterClass

Adapter class to use

CVS_IDback to summary
private static final String CVS_ID
factoryback to summary
private JDOMFactory factory

The factory for creating new JDOM objects

Constructor Detail

DOMBuilderback to summary
public DOMBuilder()

This creates a new DOMBuilder which will attempt to first locate a parser via JAXP, then will try to use a set of default parsers. The underlying parser will not validate.

DOMBuilderback to summary
public DOMBuilder(String adapterClass)

This creates a new DOMBuilder using the specified DOMAdapter implementation as a way to choose the underlying parser. The underlying parser will not validate.

Parameters
adapterClass:String

String name of class to use for DOM building.

Method Detail

buildback to summary
public Document build(Document domDocument)

This will build a JDOM tree from an existing DOM tree.

Parameters
domDocument:Document

org.w3c.dom.Document object

Returns:Document

Document - JDOM document object.

buildback to summary
public Element build(Element domElement)

This will build a JDOM Element from an existing DOM Element

Parameters
domElement:Element

org.w3c.dom.Element object

Returns:Element

Element - JDOM Element object

buildTreeback to summary
private void buildTree(Node node, Document doc, Element current, boolean atRoot)

This takes a DOM Node and builds up a JDOM tree, recursing until the DOM tree is exhausted and the JDOM tree results.

Parameters
node:Node

Code to examine.

doc:Document

JDOM Document being built.

current:Element

Element that is current parent.

atRoot:boolean

boolean indicating whether at root level.

getFactoryback to summary
public JDOMFactory getFactory()

Returns the current org.jdom.JDOMFactory in use.

Returns:JDOMFactory

the factory in use

setFactoryback to summary
public void setFactory(JDOMFactory factory)