org.jdom.input

Class DOMBuilder

public class DOMBuilder extends Object

Builds a JDOM {@link org.jdom.Document org.jdom.Document} from a pre-existing DOM {@link org.w3c.dom.Document org.w3c.dom.Document}. Also handy for testing builds from files to sanity check {@link SAXBuilder}.

Version: $Revision: 1.59 $, $Date: 2004/09/03 06:03:41 $

Author: Brett McLaughlin Jason Hunter Philip Nelson Kevin Regan Yusuf Goolamabbas Dan Schaffer Bradley S. Huffman

Constructor Summary
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.
DOMBuilder(String adapterClass)
This creates a new DOMBuilder using the specified DOMAdapter implementation as a way to choose the underlying parser.
Method Summary
Documentbuild(Document domDocument)
This will build a JDOM tree from an existing DOM tree.
Elementbuild(Element domElement)
This will build a JDOM Element from an existing DOM Element
JDOMFactorygetFactory()
Returns the current {@link org.jdom.JDOMFactory} in use.
voidsetFactory(JDOMFactory factory)

Constructor Detail

DOMBuilder

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.

DOMBuilder

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 name of class to use for DOM building.

Method Detail

build

public Document build(Document domDocument)
This will build a JDOM tree from an existing DOM tree.

Parameters: domDocument org.w3c.dom.Document object

Returns: Document - JDOM document object.

build

public Element build(Element domElement)
This will build a JDOM Element from an existing DOM Element

Parameters: domElement org.w3c.dom.Element object

Returns: Element - JDOM Element object

getFactory

public JDOMFactory getFactory()
Returns the current {@link org.jdom.JDOMFactory} in use.

Returns: the factory in use

setFactory

public void setFactory(JDOMFactory factory)
Copyright B) 2004 Jason Hunter, Brett McLaughlin. All Rights Reserved.