Package org.iso_relax.jaxp
Class ValidatingSAXParserFactory
- java.lang.Object
-
- javax.xml.parsers.SAXParserFactory
-
- org.iso_relax.jaxp.ValidatingSAXParserFactory
-
public class ValidatingSAXParserFactory extends javax.xml.parsers.SAXParserFactoryWraps anotherSAXParserFactoryand adds validation capability.
-
-
Field Summary
Fields Modifier and Type Field Description protected Schema_Schemaprotected javax.xml.parsers.SAXParserFactory_WrappedFactory
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetFeature(java.lang.String name)booleanisNamespaceAware()booleanisValidating()javax.xml.parsers.SAXParsernewSAXParser()returns a new SAX parser.voidsetFeature(java.lang.String name, boolean value)voidsetNamespaceAware(boolean awareness)voidsetValidating(boolean validating)
-
-
-
Field Detail
-
_WrappedFactory
protected javax.xml.parsers.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(javax.xml.parsers.SAXParserFactory wrapped, Schema schema)creates a new instance with an internal SAXParserFactory and Schema.- Parameters:
wrapped- internal SAXParserschema- compiled schema.
-
-
Method Detail
-
newSAXParser
public javax.xml.parsers.SAXParser newSAXParser() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXExceptionreturns a new SAX parser. If setValidating(false) is called previously, this method simply returns the implementation of wrapped SAXParser.- Specified by:
newSAXParserin classjavax.xml.parsers.SAXParserFactory- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.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- Specified by:
setFeaturein classjavax.xml.parsers.SAXParserFactory- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXNotRecognizedExceptionorg.xml.sax.SAXNotSupportedException- See Also:
SAXParserFactory.setFeature(String, boolean)
-
getFeature
public boolean getFeature(java.lang.String name) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException- Specified by:
getFeaturein classjavax.xml.parsers.SAXParserFactory- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXNotRecognizedExceptionorg.xml.sax.SAXNotSupportedException- See Also:
SAXParserFactory.getFeature(String)
-
isNamespaceAware
public boolean isNamespaceAware()
- Overrides:
isNamespaceAwarein classjavax.xml.parsers.SAXParserFactory
-
setNamespaceAware
public void setNamespaceAware(boolean awareness)
- Overrides:
setNamespaceAwarein classjavax.xml.parsers.SAXParserFactory
-
isValidating
public boolean isValidating()
- Overrides:
isValidatingin classjavax.xml.parsers.SAXParserFactory
-
setValidating
public void setValidating(boolean validating)
- Overrides:
setValidatingin classjavax.xml.parsers.SAXParserFactory
-
-