com.taursys.dom
Class JAXPDocumentAdapterBuilder

java.lang.Object
  extended bycom.taursys.dom.DocumentAdapterBuilder
      extended bycom.taursys.dom.JAXPDocumentAdapterBuilder
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class JAXPDocumentAdapterBuilder
extends DocumentAdapterBuilder
implements org.xml.sax.ErrorHandler

JAXPDocumentAdapterBuilder is used to create a DOM_2_20001113_DocumentAdapter. It provides a variety of build methods with options to validate the document source. It uses the Xerces 2.x.x DOMParser to create the DocumentAdapter.

Version:
$Revision: 1.3 $
Author:
marty

Field Summary
static java.lang.String FEATURE_COALESCING
           
static java.lang.String FEATURE_EXPAND_ENTITY_REFERENCES
           
static java.lang.String FEATURE_IGNORE_COMMENTS
           
static java.lang.String FEATURE_IGNORE_ELEMENT_CONTENT_WHITESPACE
           
static java.lang.String FEATURE_NAMESPACE_AWARE
           
static java.lang.String FEATURE_VALIDATING
           
 
Fields inherited from class com.taursys.dom.DocumentAdapterBuilder
MESSAGE_NULL_INPUT_STREAM
 
Constructor Summary
JAXPDocumentAdapterBuilder()
          Constructs new builder with FEATURE_VALIDATING, FEATURE_VALIDATION and FEATURE_LOAD_EXTERNAL_DTD features disabled.
 
Method Summary
 DocumentAdapter build(java.io.InputStream is)
          Build a new DocumentAdapter from the XML document contained in the InputStream.
 void error(org.xml.sax.SAXParseException e)
           
 void fatalError(org.xml.sax.SAXParseException e)
           
 boolean getFeature(java.lang.String featureName)
          Returns true if given featureName is enables, otherwise false See the Specific DocumentAdapterBuilder, DocumentBuilder and/or Parser for the specific Features and Properties.
 java.lang.Object getProperty(java.lang.String propertyName)
          Gets the given property.
 void setFeature(java.lang.String featureName, boolean value)
          Enables the given featureName if value is true, otherwise disables feature.
 void setProperty(java.lang.String propertyName, java.lang.Object value)
          Sets the given property to the given value.
 void warning(org.xml.sax.SAXParseException e)
           
 
Methods inherited from class com.taursys.dom.DocumentAdapterBuilder
build, build, build, build
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEATURE_COALESCING

public static final java.lang.String FEATURE_COALESCING
See Also:
Constant Field Values

FEATURE_EXPAND_ENTITY_REFERENCES

public static final java.lang.String FEATURE_EXPAND_ENTITY_REFERENCES
See Also:
Constant Field Values

FEATURE_IGNORE_COMMENTS

public static final java.lang.String FEATURE_IGNORE_COMMENTS
See Also:
Constant Field Values

FEATURE_IGNORE_ELEMENT_CONTENT_WHITESPACE

public static final java.lang.String FEATURE_IGNORE_ELEMENT_CONTENT_WHITESPACE
See Also:
Constant Field Values

FEATURE_NAMESPACE_AWARE

public static final java.lang.String FEATURE_NAMESPACE_AWARE
See Also:
Constant Field Values

FEATURE_VALIDATING

public static final java.lang.String FEATURE_VALIDATING
See Also:
Constant Field Values
Constructor Detail

JAXPDocumentAdapterBuilder

public JAXPDocumentAdapterBuilder()
Constructs new builder with FEATURE_VALIDATING, FEATURE_VALIDATION and FEATURE_LOAD_EXTERNAL_DTD features disabled.

Method Detail

setFeature

public void setFeature(java.lang.String featureName,
                       boolean value)
Description copied from class: DocumentAdapterBuilder
Enables the given featureName if value is true, otherwise disables feature. See the Specific DocumentAdapterBuilder, DocumentBuilder and/or Parser for the specific Features and Properties.

Specified by:
setFeature in class DocumentAdapterBuilder
Parameters:
featureName - to enable/disable
value - true to enable, false to disable

getFeature

public boolean getFeature(java.lang.String featureName)
Description copied from class: DocumentAdapterBuilder
Returns true if given featureName is enables, otherwise false See the Specific DocumentAdapterBuilder, DocumentBuilder and/or Parser for the specific Features and Properties.

Specified by:
getFeature in class DocumentAdapterBuilder
Parameters:
featureName - to query
Returns:
true if enabled, otherwise false

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object value)
Description copied from class: DocumentAdapterBuilder
Sets the given property to the given value. See the Specific DocumentAdapterBuilder, DocumentBuilder and/or Parser for the specific Features and Properties.

Specified by:
setProperty in class DocumentAdapterBuilder
Parameters:
propertyName - name of the property to set
value - for the property

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Description copied from class: DocumentAdapterBuilder
Gets the given property. See the Specific DocumentAdapterBuilder, DocumentBuilder and/or Parser for the specific Features and Properties.

Specified by:
getProperty in class DocumentAdapterBuilder
Parameters:
propertyName - to retrieve
Returns:
value of property

build

public DocumentAdapter build(java.io.InputStream is)
                      throws DocumentAdapterBuilderException
Description copied from class: DocumentAdapterBuilder
Build a new DocumentAdapter from the XML document contained in the InputStream.

Specified by:
build in class DocumentAdapterBuilder
Parameters:
is - InputStream containing the XML source document
Returns:
a new DocumentAdapter
Throws:
DocumentAdapterBuilderException - if invalid parameters or problems parsing the document.

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException


Copyright © 2007 Martin T Phelan. All Rights Reserved.