org.jdom.input
Class DOMBuilder

java.lang.Object
  |
  +--org.jdom.input.AbstractBuilder
        |
        +--org.jdom.input.DOMBuilder

public class DOMBuilder
extends AbstractBuilder

DOMBuilder builds a JDOM tree using DOM.

Version:
1.0
Author:
Brett McLaughlin, Jason Hunter

Constructor Summary
DOMBuilder()
           This creates a DOMBuilder with the default parser and no validation.
DOMBuilder(boolean validate)
           This sets validation for the Builder.
DOMBuilder(java.lang.String adapterClass)
           This sets the DOM Adapter class to use, and leaves validation off.
DOMBuilder(java.lang.String adapterClass, boolean validate)
           This allows the validation features to be turned on/off in the builder at creation, as well as set the DOM Adapter class to use.
 
Method Summary
 Document build(org.w3c.dom.Document domDocument)
           This will build a JDOM tree from an existing DOM tree.
 Document build(java.io.InputStream in)
           This builds a document from the supplied input stream.
 java.lang.String ltrim(java.lang.String orig)
           
 java.lang.String rtrim(java.lang.String orig)
           
 
Methods inherited from class org.jdom.input.AbstractBuilder
build, build
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMBuilder

public DOMBuilder(java.lang.String adapterClass,
                  boolean validate)

This allows the validation features to be turned on/off in the builder at creation, as well as set the DOM Adapter class to use.

Parameters:
adapterClass - String name of class to use for DOM building.
validate - boolean indicating if validation should occur.

DOMBuilder

public DOMBuilder(java.lang.String adapterClass)

This sets the DOM Adapter class to use, and leaves validation off.

Parameters:
validate - boolean indicating if validation should occur.

DOMBuilder

public DOMBuilder(boolean validate)

This sets validation for the Builder.

Parameters:
validate - boolean indicating if validation should occur.

DOMBuilder

public DOMBuilder()

This creates a DOMBuilder with the default parser and no validation.

Method Detail

build

public Document build(java.io.InputStream in)
               throws JDOMException

This builds a document from the supplied input stream.

Overrides:
build in class AbstractBuilder
Parameters:
in - InputStream to read from.
Returns:
Document - resultant Document object.
Throws:
JDOMException - when errors occur in parsing.

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.

rtrim

public java.lang.String rtrim(java.lang.String orig)

ltrim

public java.lang.String ltrim(java.lang.String orig)


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