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

public Class ParserConfigurationSettings

extends Object
implements XMLComponentManager
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xni.parser.XMLComponentManager
Known Direct Subclasses
org.apache.xerces.dom.DOMConfigurationImpl, org.apache.xerces.jaxp.validation.XMLSchemaValidatorComponentManager, org.apache.xerces.parsers.BasicParserConfiguration, org.apache.xerces.parsers.XML11Configuration, org.apache.xerces.parsers.XML11DTDConfiguration, org.apache.xerces.parsers.XML11NonValidatingConfiguration
Imports
java.util.ArrayList, .HashMap, org.apache.xerces.impl.Constants, org.apache.xerces.xni.parser.XMLComponentManager, .XMLConfigurationException

This class implements the basic operations for managing parser configuration features and properties. This utility class can be used as a base class for parser configurations or separately to encapsulate a number of parser settings as a component manager.

This class can be constructed with a "parent" settings object (in the form of an XMLComponentManager) that allows parser configuration settings to be "chained" together.

Author
Andy Clark, IBM
Version
$Id: ParserConfigurationSettings.java 447241 2006-09-18 05:12:57Z mrglavas $

Field Summary

Modifier and TypeField and Description
protected HashMap<K, V>
fFeatures

Features.

protected XMLComponentManager
fParentSettings

Parent parser configuration settings.

protected HashMap<K, V>
fProperties

Properties.

protected ArrayList<E>
fRecognizedFeatures

Recognized features.

protected ArrayList<E>
fRecognizedProperties

Recognized properties.

protected static final String

Constructor Summary

AccessConstructor and Description
public
ParserConfigurationSettings()

Default Constructor.

public
ParserConfigurationSettings(XMLComponentManager parent)

Constructs a parser configuration settings object with a parent settings object.

Method Summary

Modifier and TypeMethod and Description
public void
addRecognizedFeatures(String[]
An array of the additional feature identifiers to be recognized.
featureIds
)

Allows a parser to add parser specific features to be recognized and managed by the parser configuration.

public void
addRecognizedProperties(String[]
An array of the additional property identifiers to be recognized.
propertyIds
)

Allows a parser to add parser specific properties to be recognized and managed by the parser configuration.

protected void
checkFeature(String
The unique identifier (URI) of the feature.
featureId
)

Check a feature.

protected void
checkProperty(String
The unique identifier (URI) of the property being set.
propertyId
)

Check a property.

public boolean

Returns:

true if the feature is supported
getFeature
(String
The feature identifier.
featureId
)

Implements org.apache.xerces.xni.parser.XMLComponentManager.getFeature.

Returns the state of a feature.
public Object

Returns:

the value of the property
getProperty
(String
The property identifier.
propertyId
)

Implements org.apache.xerces.xni.parser.XMLComponentManager.getProperty.

Returns the value of a property.
public void
setFeature(String
The unique identifier (URI) of the feature.
featureId
,
boolean
The requested state of the feature (true or false).
state
)

Set the state of a feature.

public void
setProperty(String propertyId, Object value)

setProperty

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fFeaturesback to summary
protected HashMap<K, V> fFeatures

Features.

fParentSettingsback to summary
protected XMLComponentManager fParentSettings

Parent parser configuration settings.

fPropertiesback to summary
protected HashMap<K, V> fProperties

Properties.

fRecognizedFeaturesback to summary
protected ArrayList<E> fRecognizedFeatures

Recognized features.

fRecognizedPropertiesback to summary
protected ArrayList<E> fRecognizedProperties

Recognized properties.

PARSER_SETTINGSback to summary
protected static final String PARSER_SETTINGS

Constructor Detail

ParserConfigurationSettingsback to summary
public ParserConfigurationSettings()

Default Constructor.

ParserConfigurationSettingsback to summary
public ParserConfigurationSettings(XMLComponentManager parent)

Constructs a parser configuration settings object with a parent settings object.

Method Detail

addRecognizedFeaturesback to summary
public void addRecognizedFeatures(String[] featureIds)

Allows a parser to add parser specific features to be recognized and managed by the parser configuration.

Parameters
featureIds:String[]

An array of the additional feature identifiers to be recognized.

addRecognizedPropertiesback to summary
public void addRecognizedProperties(String[] propertyIds)

Allows a parser to add parser specific properties to be recognized and managed by the parser configuration.

Parameters
propertyIds:String[]

An array of the additional property identifiers to be recognized.

checkFeatureback to summary
protected void checkFeature(String featureId) throws XMLConfigurationException

Check a feature. If feature is known and supported, this method simply returns. Otherwise, the appropriate exception is thrown.

Parameters
featureId:String

The unique identifier (URI) of the feature.

Exceptions
XMLConfigurationException:
If the requested feature is not known.
checkPropertyback to summary
protected void checkProperty(String propertyId) throws XMLConfigurationException

Check a property. If the property is known and supported, this method simply returns. Otherwise, the appropriate exception is thrown.

Parameters
propertyId:String

The unique identifier (URI) of the property being set.

Exceptions
XMLConfigurationException:
If the requested feature is not known.
getFeatureback to summary
public boolean getFeature(String featureId) throws XMLConfigurationException

Implements org.apache.xerces.xni.parser.XMLComponentManager.getFeature.

Returns the state of a feature.

Parameters
featureId:String

The feature identifier.

Returns:boolean

true if the feature is supported

Exceptions
XMLConfigurationException:
Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
getPropertyback to summary
public Object getProperty(String propertyId) throws XMLConfigurationException

Implements org.apache.xerces.xni.parser.XMLComponentManager.getProperty.

Returns the value of a property.

Parameters
propertyId:String

The property identifier.

Returns:Object

the value of the property

Exceptions
XMLConfigurationException:
Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
setFeatureback to summary
public void setFeature(String featureId, boolean state) throws XMLConfigurationException

Set the state of a feature. Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and if it does recognize it, it might not be able to fulfill the request.

Parameters
featureId:String

The unique identifier (URI) of the feature.

state:boolean

The requested state of the feature (true or false).

Exceptions
XMLConfigurationException:
If the requested feature is not known.
setPropertyback to summary
public void setProperty(String propertyId, Object value) throws XMLConfigurationException

setProperty

Exceptions
XMLConfigurationException:
If the requested feature is not known.