JDOM2
0.0.2-BETA

org.jdom2.input
Class DOMBuilder

java.lang.Object
  extended by org.jdom2.input.DOMBuilder

public class DOMBuilder
extends java.lang.Object

Builds a JDOM org.jdom2.Document from a pre-existing DOM org.w3c.dom.Document. Also handy for testing builds from files to sanity check SAXBuilder.

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.
 
Method Summary
 CDATA build(org.w3c.dom.CDATASection cdata)
          This will build a JDOM CDATA from an existing DOM CDATASection
 Comment build(org.w3c.dom.Comment comment)
          This will build a JDOM Comment from an existing DOM Comment
 Document build(org.w3c.dom.Document domDocument)
          This will build a JDOM tree from an existing DOM tree.
 DocType build(org.w3c.dom.DocumentType doctype)
          This will build a JDOM Element from an existing DOM Element
 Element build(org.w3c.dom.Element domElement)
          This will build a JDOM Element from an existing DOM Element
 EntityRef build(org.w3c.dom.EntityReference er)
          This will build a JDOM EntityRef from an existing DOM EntityReference
 ProcessingInstruction build(org.w3c.dom.ProcessingInstruction pi)
          This will build a JDOM ProcessingInstruction from an existing DOM ProcessingInstruction
 Text build(org.w3c.dom.Text text)
          This will build a JDOM Text from an existing DOM Text
 JDOMFactory getFactory()
          Returns the current JDOMFactory in use.
 void setFactory(JDOMFactory factory)
          This sets a custom JDOMFactory for the builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

Method Detail

setFactory

public void setFactory(JDOMFactory factory)
This sets a custom JDOMFactory for the builder. Use this to build the tree with your own subclasses of the JDOM classes.

Parameters:
factory - JDOMFactory to use

getFactory

public JDOMFactory getFactory()
Returns the current JDOMFactory in use.

Returns:
the factory in use

build

public Document build(org.w3c.dom.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(org.w3c.dom.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

build

public CDATA build(org.w3c.dom.CDATASection cdata)
This will build a JDOM CDATA from an existing DOM CDATASection

Parameters:
cdata - org.w3c.dom.CDATASection object
Returns:
CDATA - JDOM CDATA object
Since:
JDOM2

build

public Text build(org.w3c.dom.Text text)
This will build a JDOM Text from an existing DOM Text

Parameters:
text - org.w3c.dom.Text object
Returns:
Text - JDOM Text object
Since:
JDOM2

build

public Comment build(org.w3c.dom.Comment comment)
This will build a JDOM Comment from an existing DOM Comment

Parameters:
comment - org.w3c.dom.Comment object
Returns:
Comment - JDOM Comment object
Since:
JDOM2

build

public ProcessingInstruction build(org.w3c.dom.ProcessingInstruction pi)
This will build a JDOM ProcessingInstruction from an existing DOM ProcessingInstruction

Parameters:
pi - org.w3c.dom.ProcessingInstruction object
Returns:
ProcessingInstruction - JDOM ProcessingInstruction object
Since:
JDOM2

build

public EntityRef build(org.w3c.dom.EntityReference er)
This will build a JDOM EntityRef from an existing DOM EntityReference

Parameters:
er - org.w3c.dom.EntityReference object
Returns:
EnityRef - JDOM EntityRef object
Since:
JDOM2

build

public DocType build(org.w3c.dom.DocumentType doctype)
This will build a JDOM Element from an existing DOM Element

Parameters:
doctype - org.w3c.dom.Element object
Returns:
Element - JDOM Element object
Since:
JDOM2

JDOM2
0.0.2-BETA

Copyright © 2011 Jason Hunter, Brett McLaughlin. All Rights Reserved.