org.iso_relax.jaxp
Class ValidatingDocumentBuilderFactory

java.lang.Object
  |
  +--javax.xml.parsers.DocumentBuilderFactory
        |
        +--org.iso_relax.jaxp.ValidatingDocumentBuilderFactory

public class ValidatingDocumentBuilderFactory
extends DocumentBuilderFactory

Wraps another DocumentBuilderFactory and adds validation capability.

Author:
Daisuke OKAJIMA

Field Summary
protected  Schema _Schema
           
protected  DocumentBuilderFactory _WrappedFactory
           
 
Constructor Summary
ValidatingDocumentBuilderFactory(DocumentBuilderFactory wrapped, Schema schema)
          creates a new instance with an internal DocumentBuilderFactory and Schema.
ValidatingDocumentBuilderFactory(Schema schema)
          creates a new instance that wraps the default DocumentBuilderFactory
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
           
 boolean isCoalescing()
           
 boolean isExpandEntityReference()
           
 boolean isIgnoringComments()
           
 boolean isIgnoringElementContentWhitespace()
           
 boolean isNamespaceAware()
           
 boolean isValidating()
           
 DocumentBuilder newDocumentBuilder()
          returns a new DOM parser.
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 void setCoalescing(boolean coalescing)
           
 void setExpandEntityReference(boolean expandEntityRef)
           
 void setIgnoringComments(boolean ignoreComments)
           
 void setIgnoringElementContentWhitespace(boolean whitespace)
           
 void setNamespaceAware(boolean awareness)
           
 void setValidating(boolean _validating)
           
 
Methods inherited from class javax.xml.parsers.DocumentBuilderFactory
isExpandEntityReferences, newInstance, setExpandEntityReferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_Schema

protected Schema _Schema

_WrappedFactory

protected DocumentBuilderFactory _WrappedFactory
Constructor Detail

ValidatingDocumentBuilderFactory

public ValidatingDocumentBuilderFactory(Schema schema)
creates a new instance that wraps the default DocumentBuilderFactory

Parameters:
schema - the compiled Schema object. It can not be null.

ValidatingDocumentBuilderFactory

public ValidatingDocumentBuilderFactory(DocumentBuilderFactory wrapped,
                                        Schema schema)
creates a new instance with an internal DocumentBuilderFactory and Schema.

Parameters:
wrapped - internal DocumentBuilderFactory
schema - compiled schema.
Method Detail

newDocumentBuilder

public DocumentBuilder newDocumentBuilder()
                                   throws ParserConfigurationException
returns a new DOM parser. If setValidating(false) is called previously, this method simply returns the implementation of wrapped DocumentBuilder.

Specified by:
newDocumentBuilder in class DocumentBuilderFactory
ParserConfigurationException

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Specified by:
setAttribute in class DocumentBuilderFactory
See Also:
DocumentBuilderFactory.setAttribute(String, Object)

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Specified by:
getAttribute in class DocumentBuilderFactory
See Also:
DocumentBuilderFactory.getAttribute(String)

isValidating

public boolean isValidating()
Overrides:
isValidating in class DocumentBuilderFactory

setValidating

public void setValidating(boolean _validating)
Overrides:
setValidating in class DocumentBuilderFactory

isCoalescing

public boolean isCoalescing()
Overrides:
isCoalescing in class DocumentBuilderFactory

isExpandEntityReference

public boolean isExpandEntityReference()

isIgnoringComments

public boolean isIgnoringComments()
Overrides:
isIgnoringComments in class DocumentBuilderFactory

isIgnoringElementContentWhitespace

public boolean isIgnoringElementContentWhitespace()
Overrides:
isIgnoringElementContentWhitespace in class DocumentBuilderFactory

isNamespaceAware

public boolean isNamespaceAware()
Overrides:
isNamespaceAware in class DocumentBuilderFactory

setCoalescing

public void setCoalescing(boolean coalescing)
Overrides:
setCoalescing in class DocumentBuilderFactory

setExpandEntityReference

public void setExpandEntityReference(boolean expandEntityRef)

setIgnoringComments

public void setIgnoringComments(boolean ignoreComments)
Overrides:
setIgnoringComments in class DocumentBuilderFactory

setIgnoringElementContentWhitespace

public void setIgnoringElementContentWhitespace(boolean whitespace)
Overrides:
setIgnoringElementContentWhitespace in class DocumentBuilderFactory

setNamespaceAware

public void setNamespaceAware(boolean awareness)
Overrides:
setNamespaceAware in class DocumentBuilderFactory