org.cdmckay.coffeedom.input
Class DOMBuilder

java.lang.Object
  extended by org.cdmckay.coffeedom.input.DOMBuilder

public class DOMBuilder
extends Object

Builds a CoffeeDOM 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, Cameron McKay

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 adapterClassName)
          This creates a new DOMBuilder using the specified DOMAdapter implementation as a way to choose the underlying parser.
 
Method Summary
 Document build(Document domDocument)
          This will build a CoffeeDOM tree from an existing DOM tree.
 Element build(Element domElement)
          This will build a CoffeeDOM Element from an existing DOM Element
 CoffeeDOMFactory getFactory()
          Returns the current CoffeeDOMFactory in use.
 void setFactory(CoffeeDOMFactory factory)
           
 
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.


DOMBuilder

public DOMBuilder(String adapterClassName)
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:
adapterClassName - String name of class to use for DOM building.
Method Detail

setFactory

public void setFactory(CoffeeDOMFactory factory)

getFactory

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

Returns:
the factory in use

build

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

Parameters:
domDocument - org.w3c.dom.Document object
Returns:
Document - CoffeeDOM document object.

build

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

Parameters:
domElement - org.w3c.dom.Element object
Returns:
Element - CoffeeDOM Element object


Copyright © 2011. All Rights Reserved.