org.iso_relax.jaxp
Class ValidatingSAXParserFactory

java.lang.Object
  extended byjavax.xml.parsers.SAXParserFactory
      extended byorg.iso_relax.jaxp.ValidatingSAXParserFactory

public class ValidatingSAXParserFactory
extends javax.xml.parsers.SAXParserFactory

Wraps another SAXParserFactory and adds validation capability.

Author:
Daisuke OKAJIMA

Constructor Summary
ValidatingSAXParserFactory(javax.xml.parsers.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()
           
 javax.xml.parsers.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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatingSAXParserFactory

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

Parameters:
wrapped - internal SAXParser
schema - compiled schema.

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.
Method Detail

getFeature

public boolean getFeature(java.lang.String name)
                   throws javax.xml.parsers.ParserConfigurationException,
                          org.xml.sax.SAXNotRecognizedException,
                          org.xml.sax.SAXNotSupportedException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
See Also:
SAXParserFactory.getFeature(String)

isNamespaceAware

public boolean isNamespaceAware()

isValidating

public boolean isValidating()

newSAXParser

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

Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws javax.xml.parsers.ParserConfigurationException,
                       org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
See Also:
SAXParserFactory.setFeature(String, boolean)

setNamespaceAware

public void setNamespaceAware(boolean awareness)

setValidating

public void setValidating(boolean validating)