public class

ParserConfigurationSettings

extends Object
implements XMLComponentManager
java.lang.Object
   ↳ org.apache.xerces.util.ParserConfigurationSettings
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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.

Summary

Constants
String PARSER_SETTINGS
Fields
protected HashMap fFeatures Features.
protected XMLComponentManager fParentSettings Parent parser configuration settings.
protected HashMap fProperties Properties.
protected ArrayList fRecognizedFeatures Recognized features.
protected ArrayList fRecognizedProperties Recognized properties.
Public Constructors
ParserConfigurationSettings()
Default Constructor.
ParserConfigurationSettings(XMLComponentManager parent)
Constructs a parser configuration settings object with a parent settings object.
Public Methods
void addRecognizedFeatures(String[] featureIds)
Allows a parser to add parser specific features to be recognized and managed by the parser configuration.
void addRecognizedProperties(String[] propertyIds)
Allows a parser to add parser specific properties to be recognized and managed by the parser configuration.
boolean getFeature(String featureId)
Returns the state of a feature.
Object getProperty(String propertyId)
Returns the value of a property.
void setFeature(String featureId, boolean state)
Set the state of a feature.
void setProperty(String propertyId, Object value)
setProperty
Protected Methods
void checkFeature(String featureId)
Check a feature.
void checkProperty(String propertyId)
Check a property.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.xerces.xni.parser.XMLComponentManager

Constants

protected static final String PARSER_SETTINGS

Constant Value: "http://apache.org/xml/features/internal/parser-settings"

Fields

protected HashMap fFeatures

Features.

protected XMLComponentManager fParentSettings

Parent parser configuration settings.

protected HashMap fProperties

Properties.

protected ArrayList fRecognizedFeatures

Recognized features.

protected ArrayList fRecognizedProperties

Recognized properties.

Public Constructors

public ParserConfigurationSettings ()

Default Constructor.

public ParserConfigurationSettings (XMLComponentManager parent)

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

Public Methods

public void addRecognizedFeatures (String[] featureIds)

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

Parameters
featureIds An array of the additional feature identifiers to be recognized.

public void addRecognizedProperties (String[] propertyIds)

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

Parameters
propertyIds An array of the additional property identifiers to be recognized.

public boolean getFeature (String featureId)

Returns the state of a feature.

Parameters
featureId The feature identifier.
Returns
  • true if the feature is supported
Throws
XMLConfigurationException Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

public Object getProperty (String propertyId)

Returns the value of a property.

Parameters
propertyId The property identifier.
Returns
  • the value of the property
Throws
XMLConfigurationException Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

public void setFeature (String featureId, boolean state)

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 The unique identifier (URI) of the feature.
state The requested state of the feature (true or false).
Throws
XMLConfigurationException If the requested feature is not known.

public void setProperty (String propertyId, Object value)

setProperty

Throws
XMLConfigurationException If the requested feature is not known.

Protected Methods

protected void checkFeature (String featureId)

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

Parameters
featureId The unique identifier (URI) of the feature.
Throws
XMLConfigurationException If the requested feature is not known.

protected void checkProperty (String propertyId)

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

Parameters
propertyId The unique identifier (URI) of the property being set.
Throws
XMLConfigurationException If the requested feature is not known.