org.iso_relax.jaxp
Class ValidatingSAXParserFactory

java.lang.Object
  |
  +--javax.xml.parsers.SAXParserFactory
        |
        +--org.iso_relax.jaxp.ValidatingSAXParserFactory

public class ValidatingSAXParserFactory
extends SAXParserFactory

Wraps another SAXParserFactory and adds validation capability.

Author:
Daisuke OKAJIMA

Field Summary
protected  Schema _Schema
           
protected  SAXParserFactory _WrappedFactory
           
 
Constructor Summary
ValidatingSAXParserFactory(SAXParserFactory wrapped, Schema schema)
          creates a new instance with an internal SAXParserFactory and Schema.
ValidatingSAXParserFactory(Schema schema)
          creates a new instance that wraps the default DocumentBuilderFactory
 
Method Summary
 boolean getFeature(java.lang.String name)
           
 boolean isNamespaceAware()
           
 boolean isValidating()
           
 SAXParser newSAXParser()
          returns a new SAX parser.
 void setFeature(java.lang.String name, boolean value)
           
 void setNamespaceAware(boolean awareness)
           
 void setValidating(boolean validating)
           
 
Methods inherited from class javax.xml.parsers.SAXParserFactory
newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_WrappedFactory

protected SAXParserFactory _WrappedFactory

_Schema

protected Schema _Schema
Constructor Detail

ValidatingSAXParserFactory

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

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

ValidatingSAXParserFactory

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

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

newSAXParser

public SAXParser newSAXParser()
                       throws ParserConfigurationException,
                              SAXException
returns a new SAX parser. If setValidating(false) is called previously, this method simply returns the implementation of wrapped SAXParser.

Specified by:
newSAXParser in class SAXParserFactory
ParserConfigurationException
SAXException

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws ParserConfigurationException,
                       SAXNotRecognizedException,
                       SAXNotSupportedException
Specified by:
setFeature in class SAXParserFactory
ParserConfigurationException
SAXNotRecognizedException
SAXNotSupportedException
See Also:
SAXParserFactory.setFeature(String, boolean)

getFeature

public boolean getFeature(java.lang.String name)
                   throws ParserConfigurationException,
                          SAXNotRecognizedException,
                          SAXNotSupportedException
Specified by:
getFeature in class SAXParserFactory
ParserConfigurationException
SAXNotRecognizedException
SAXNotSupportedException
See Also:
SAXParserFactory.getFeature(String)

isNamespaceAware

public boolean isNamespaceAware()
Overrides:
isNamespaceAware in class SAXParserFactory

setNamespaceAware

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

isValidating

public boolean isValidating()
Overrides:
isValidating in class SAXParserFactory

setValidating

public void setValidating(boolean validating)
Overrides:
setValidating in class SAXParserFactory