Top Description Fields Constructors Methods
org.apache.xerces.jaxp

public Class SAXParserFactoryImpl

extends SAXParserFactory
Class Inheritance
Imports
java.util.Hashtable, javax.xml.XMLConstants, javax.xml.parsers.ParserConfigurationException, .SAXParser, .SAXParserFactory, javax.xml.validation.Schema, org.apache.xerces.impl.Constants, org.xml.sax.SAXException, .SAXNotRecognizedException, .SAXNotSupportedException

This is the implementation specific class for the javax.xml.parsers.SAXParserFactory. This is the platform default implementation for the platform.
Authors
Rajiv Mordani, Edwin Goei
Version
$Id: SAXParserFactoryImpl.java 447237 2006-09-18 05:03:10Z mrglavas $

Field Summary

Modifier and TypeField and Description
private Hashtable<K, V>
private boolean
fSecureProcess

State of the secure processing feature, initially false

private Schema
private boolean
private static final String
NAMESPACES_FEATURE

Feature identifier: namespaces.

private static final String
VALIDATION_FEATURE

Feature identifier: validation.

private static final String
XINCLUDE_FEATURE

Feature identifier: XInclude processing

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
getFeature(String
The name of the property to be retrieved.
name
)

Implements abstract javax.xml.parsers.SAXParserFactory.getFeature.

returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.
public Schema
getSchema()

Overrides javax.xml.parsers.SAXParserFactory.getSchema.

Gets the Schema object specified through the setSchema(Schema schema) method.
public boolean
isXIncludeAware()

Overrides javax.xml.parsers.SAXParserFactory.isXIncludeAware.

Get state of XInclude processing.
public SAXParser

Returns:

javax.xml.parsers.SAXParser
newSAXParser
()

Implements abstract javax.xml.parsers.SAXParserFactory.newSAXParser.

Creates a new instance of SAXParser using the currently configured factory parameters.
private SAXParserImpl
newSAXParserImpl()

Common code for translating exceptions

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.xml.parsers.SAXParserFactory.setFeature.

Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader.
public void
setSchema(Schema
Schema to use, null to remove a schema.
grammar
)

Overrides javax.xml.parsers.SAXParserFactory.setSchema.

Set the Schema to be used by parsers created from this factory.
public void
setXIncludeAware(boolean
Set XInclude processing to true or false
state
)

Overrides javax.xml.parsers.SAXParserFactory.setXIncludeAware.

Set state of XInclude processing.
Inherited from javax.xml.parsers.SAXParserFactory:
isNamespaceAwareisValidatingnewDefaultInstancenewDefaultNSInstancenewInstancenewInstancenewNSInstancenewNSInstancesetNamespaceAwaresetValidating

Field Detail

featuresback to summary
private Hashtable<K, V> features
fSecureProcessback to summary
private boolean fSecureProcess

State of the secure processing feature, initially false

grammarback to summary
private Schema grammar
isXIncludeAwareback to summary
private boolean isXIncludeAware
NAMESPACES_FEATUREback to summary
private static final String NAMESPACES_FEATURE

Feature identifier: namespaces.

VALIDATION_FEATUREback to summary
private static final String VALIDATION_FEATURE

Feature identifier: validation.

XINCLUDE_FEATUREback to summary
private static final String XINCLUDE_FEATURE

Feature identifier: XInclude processing

Constructor Detail

SAXParserFactoryImplback to summary
public SAXParserFactoryImpl()

Method Detail

getFeatureback to summary
public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException

Implements abstract javax.xml.parsers.SAXParserFactory.getFeature.

returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.

Parameters
name:String

Doc from javax.xml.parsers.SAXParserFactory.getFeature.

The name of the property to be retrieved.

Returns:boolean

Doc from javax.xml.parsers.SAXParserFactory.getFeature.

Value of the requested property.

Exceptions
ParserConfigurationException:

Doc from javax.xml.parsers.SAXParserFactory.getFeature.

if a parser cannot be created which satisfies the requested configuration.

SAXNotRecognizedException:

Doc from javax.xml.parsers.SAXParserFactory.getFeature.

When the underlying XMLReader does not recognize the property name.

SAXNotSupportedException:

Doc from javax.xml.parsers.SAXParserFactory.getFeature.

When the underlying XMLReader recognizes the property name but doesn't support the property.

getSchemaback to summary
public Schema getSchema()

Overrides javax.xml.parsers.SAXParserFactory.getSchema.

Doc from javax.xml.parsers.SAXParserFactory.getSchema.

Gets the Schema object specified through the setSchema(Schema schema) method.

Returns:Schema

the Schema object that was last set through the setSchema(Schema) method, or null if the method was not invoked since a SAXParserFactory is created.

isXIncludeAwareback to summary
public boolean isXIncludeAware()

Overrides javax.xml.parsers.SAXParserFactory.isXIncludeAware.

Doc from javax.xml.parsers.SAXParserFactory.isXIncludeAware.

Get state of XInclude processing.

Returns:boolean

current state of XInclude processing

newSAXParserback to summary
public SAXParser newSAXParser() throws ParserConfigurationException

Implements abstract javax.xml.parsers.SAXParserFactory.newSAXParser.

Creates a new instance of SAXParser using the currently configured factory parameters.

Returns:SAXParser

javax.xml.parsers.SAXParser

Exceptions
ParserConfigurationException:

Doc from javax.xml.parsers.SAXParserFactory.newSAXParser.

if a parser cannot be created which satisfies the requested configuration.

newSAXParserImplback to summary
private SAXParserImpl newSAXParserImpl() throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException

Common code for translating exceptions

setFeatureback to summary
public void setFeature(String name, boolean value) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException

Implements abstract javax.xml.parsers.SAXParserFactory.setFeature.

Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader.

Parameters
name:String

Doc from javax.xml.parsers.SAXParserFactory.setFeature.

The name of the feature to be set.

value:boolean

Doc from javax.xml.parsers.SAXParserFactory.setFeature.

The value of the feature to be set.

Exceptions
ParserConfigurationException:

Doc from javax.xml.parsers.SAXParserFactory.setFeature.

if a parser cannot be created which satisfies the requested configuration.

SAXNotRecognizedException:

Doc from javax.xml.parsers.SAXParserFactory.setFeature.

When the underlying XMLReader does not recognize the property name.

SAXNotSupportedException:

Doc from javax.xml.parsers.SAXParserFactory.setFeature.

When the underlying XMLReader recognizes the property name but doesn't support the property.

setSchemaback to summary
public void setSchema(Schema grammar)

Overrides javax.xml.parsers.SAXParserFactory.setSchema.

Doc from javax.xml.parsers.SAXParserFactory.setSchema.

Set the Schema to be used by parsers created from this factory.

When a Schema is non-null, a parser will use a validator created from it to validate documents before it passes information down to the application.

When warnings/errors/fatal errors are found by the validator, the parser must handle them as if those errors were found by the parser itself. In other words, if the user-specified org.xml.sax.ErrorHandler is set, it must receive those errors, and if not, they must be treated according to the implementation specific default error handling rules.

A validator may modify the SAX event stream (for example by adding default values that were missing in documents), and a parser is responsible to make sure that the application will receive those modified event stream.

Initially, null is set as the Schema.

This processing will take effect even if the isValidating() method returns false.

It is an error to use the http://java.sun.com/xml/jaxp/properties/schemaSource property and/or the http://java.sun.com/xml/jaxp/properties/schemaLanguage property in conjunction with a non-null Schema object. Such configuration will cause a SAXException exception when those properties are set on a SAXParser.

Note for implementors

A parser must be able to work with any Schema implementation. However, parsers and schemas are allowed to use implementation-specific custom mechanisms as long as they yield the result described in the specification.

Parameters
grammar:Schema

Schema to use, null to remove a schema.

setXIncludeAwareback to summary
public void setXIncludeAware(boolean state)

Overrides javax.xml.parsers.SAXParserFactory.setXIncludeAware.

Doc from javax.xml.parsers.SAXParserFactory.setXIncludeAware.

Set state of XInclude processing.

If XInclude markup is found in the document instance, should it be processed as specified in XML Inclusions (XInclude) Version 1.0.

XInclude processing defaults to false.

Parameters
state:boolean

Set XInclude processing to true or false