This class uses another SAXParserFactory implementation and adds the validation capability to it.
| Modifier and Type | Field and Description |
|---|---|
| private final SAXParserFactory | core
Actual SAXParserFactory implementation. |
| private final VerifierFactory | jarvFactory
JARV VerifierFactory implementation, which will be used to parse schemas. |
| private Schema | schema
JARV Schema object which is associated with this factory, or null. |
| Access | Constructor and Description |
|---|---|
| public | SAXParserFactoryImpl()
Creates a new instance by using the default SAXParserFactory implementation as the underlying parser. |
| public | SAXParserFactoryImpl(SAXParserFactory _factory)
Creates a new instance by specifying the underlying SAXParserFactory implementation. |
| public | SAXParserFactoryImpl(Schema schema)
Creates a new instance by using a default SAXParserFactory implementation and the specified schema object. |
| public | SAXParserFactoryImpl(File schemaAsFile)
Creates a new instance that validates documents against the specified schema. |
| public | SAXParserFactoryImpl(InputSource _schema)
Creates a new instance that validates documents against the specified schema. |
| public | SAXParserFactoryImpl(String schemaUrl)
Creates a new instance that validates documents against the specified schema. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | getFeature(String
The name of the property to be retrieved. name)Implements abstract javax. |
| public boolean | isNamespaceAware()
Overrides javax. |
| public boolean | isValidating()
Indicates whether or not the factory is configured to produce
parsers which validate the XML content during parse.
|
| public SAXParser | newSAXParser()
Implements abstract javax. |
| public void | setFeature(String
The name of the feature to be set. name, boolean The value of the feature to be set. value)Implements abstract javax. |
| public void | setNamespaceAware(boolean
true if the parser produced by this code will
provide support for XML namespaces; false otherwise. awareness)Overrides javax. |
| public void | setValidating(boolean
true if the parser produced by this code will
validate documents as they are parsed; false otherwise. validating)
Specifies that the parser produced by this code will
validate documents as they are parsed.
|
| core | back to summary |
|---|---|
| private final SAXParserFactory core Actual SAXParserFactory implementation. | |
| jarvFactory | back to summary |
|---|---|
| private final VerifierFactory jarvFactory JARV VerifierFactory implementation, which will be used to parse schemas. | |
| schema | back to summary |
|---|---|
| private Schema schema JARV Schema object which is associated with this factory, or null. | |
| SAXParserFactoryImpl | back to summary |
|---|---|
| public SAXParserFactoryImpl() Creates a new instance by using the default SAXParserFactory implementation as the underlying parser. This constructor does not set any schema. | |
| SAXParserFactoryImpl | back to summary |
|---|---|
| public SAXParserFactoryImpl(SAXParserFactory _factory) Creates a new instance by specifying the underlying SAXParserFactory implementation. This constructor does not set any schema. | |
| SAXParserFactoryImpl | back to summary |
|---|---|
| public SAXParserFactoryImpl(Schema schema) Creates a new instance by using a default SAXParserFactory implementation and the specified schema object. | |
| SAXParserFactoryImpl | back to summary |
|---|---|
| public SAXParserFactoryImpl(File schemaAsFile) throws VerifierConfigurationException, SAXException, IOException Creates a new instance that validates documents against the specified schema. | |
| SAXParserFactoryImpl | back to summary |
|---|---|
| public SAXParserFactoryImpl(InputSource _schema) throws VerifierConfigurationException, SAXException, IOException Creates a new instance that validates documents against the specified schema. | |
| SAXParserFactoryImpl | back to summary |
|---|---|
| public SAXParserFactoryImpl(String schemaUrl) throws VerifierConfigurationException, SAXException, IOException Creates a new instance that validates documents against the specified schema. | |
| SAXParserFactoryImpl | back to summary |
|---|---|
| public SAXParserFactoryImpl(SAXParserFactory _factory, Schema _schema) | |
| getFeature | back to summary |
|---|---|
| public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException Implements abstract javax. Doc from javax. Returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.
| |
| isNamespaceAware | back to summary |
|---|---|
| public boolean isNamespaceAware() Overrides javax. Doc from javax. Indicates whether or not the factory is configured to produce parsers which are namespace aware.
| |
| isValidating | back to summary |
|---|---|
| public boolean isValidating() Overrides javax. Doc from javax. Indicates whether or not the factory is configured to produce parsers which validate the XML content during parse.
| |
| newSAXParser | back to summary |
|---|---|
| public SAXParser newSAXParser() throws ParserConfigurationException, SAXException Implements abstract javax. Doc from javax. Creates a new instance of a SAXParser using the currently configured factory parameters.
| |
| setFeature | back to summary |
|---|---|
| public void setFeature(String name, boolean value) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException Implements abstract javax. Doc from javax. Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader. A list of the core features and properties can be found at http://www.saxproject.org/ All implementations are required to support the
| |
| setNamespaceAware | back to summary |
|---|---|
| public void setNamespaceAware(boolean awareness) Overrides javax. Doc from javax. Specifies that the parser produced by this code will
provide support for XML namespaces. By default the value of this is set
to
| |
| setValidating | back to summary |
|---|---|
| public void setValidating(boolean validating) Overrides javax. Doc from javax. Specifies that the parser produced by this code will
validate documents as they are parsed. By default the value of this is
set to Note that "the validation" here means a validating parser as defined in the XML recommendation. In other words, it essentially just controls the DTD validation. (except the legacy two properties defined in JAXP 1.2.)
To use modern schema languages such as W3C XML Schema or
RELAX NG instead of DTD, you can configure your parser to be
a non-validating parser by leaving the
| |