APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.util

public Class ParserConfigurationSettings

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

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

Field Summary

Modifier and TypeField and Description
protected Map<String, Boolean>
fFeatures

Features.

protected XMLComponentManager
fParentSettings

Parent parser configuration settings.

protected Map<String, Object>
fProperties

Properties.

protected List<String>
fRecognizedFeatures

Recognized features.

protected List<String>
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 FeatureState
checkFeature(String
The unique identifier (URI) of the feature.
featureId
)

Check a feature.

protected PropertyState

Returns:

the PropertyState
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 com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getFeature.

Returns the state of a feature.

public final boolean
getFeature(String featureId, boolean defaultValue)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getFeature.

Returns the state of a feature.

public FeatureState
public Object

Returns:

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

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getProperty.

Returns the value of a property.

public final Object
getProperty(String propertyId, Object defaultValue)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getProperty.

Returns the value of a property.

public PropertyState
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 Map<String, Boolean> fFeatures

Features.

fParentSettingsback to summary
protected XMLComponentManager fParentSettings

Parent parser configuration settings.

fPropertiesback to summary
protected Map<String, Object> fProperties

Properties.

fRecognizedFeaturesback to summary
protected List<String> fRecognizedFeatures

Recognized features.

fRecognizedPropertiesback to summary
protected List<String> 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 FeatureState 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 PropertyState 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.

Returns:PropertyState

the PropertyState

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

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getFeature.

Returns the state of a feature.

Parameters
featureId:String

The feature identifier.

Returns:boolean

true if the feature is supported

Annotations
@Override
Exceptions
XMLConfigurationException:
Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
getFeatureback to summary
public final boolean getFeature(String featureId, boolean defaultValue)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getFeature.

Doc from com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getFeature.

Returns the state of a feature. Does not throw exceptions.

Annotations
@Override
getFeatureStateback to summary
public FeatureState getFeatureState(String featureId)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getFeatureState.

Annotations
@Override
getPropertyback to summary
public Object getProperty(String propertyId) throws XMLConfigurationException

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getProperty.

Returns the value of a property.

Parameters
propertyId:String

The property identifier.

Returns:Object

the value of the property

Annotations
@Override
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 final Object getProperty(String propertyId, Object defaultValue)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getProperty.

Doc from com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getProperty.

Returns the value of a property. Does not throw exceptions.

Annotations
@Override
getPropertyStateback to summary
public PropertyState getPropertyState(String propertyId)

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager.getPropertyState.

Annotations
@Override
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.