Package org.apache.xerces.util
Class ParserConfigurationSettings
- java.lang.Object
-
- org.apache.xerces.util.ParserConfigurationSettings
-
- All Implemented Interfaces:
org.apache.xerces.xni.parser.XMLComponentManager
- Direct Known Subclasses:
BasicParserConfiguration,DOMConfigurationImpl,XML11Configuration,XML11DTDConfiguration,XML11NonValidatingConfiguration
public class ParserConfigurationSettings extends java.lang.Object implements org.apache.xerces.xni.parser.XMLComponentManagerThis 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.- Version:
- $Id: ParserConfigurationSettings.java 447241 2006-09-18 05:12:57Z mrglavas $
- Author:
- Andy Clark, IBM
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.HashMapfFeaturesFeatures.protected org.apache.xerces.xni.parser.XMLComponentManagerfParentSettingsParent parser configuration settings.protected java.util.HashMapfPropertiesProperties.protected java.util.ArrayListfRecognizedFeaturesRecognized features.protected java.util.ArrayListfRecognizedPropertiesRecognized properties.protected static java.lang.StringPARSER_SETTINGS
-
Constructor Summary
Constructors Constructor Description ParserConfigurationSettings()Default Constructor.ParserConfigurationSettings(org.apache.xerces.xni.parser.XMLComponentManager parent)Constructs a parser configuration settings object with a parent settings object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRecognizedFeatures(java.lang.String[] featureIds)Allows a parser to add parser specific features to be recognized and managed by the parser configuration.voidaddRecognizedProperties(java.lang.String[] propertyIds)Allows a parser to add parser specific properties to be recognized and managed by the parser configuration.protected voidcheckFeature(java.lang.String featureId)Check a feature.protected voidcheckProperty(java.lang.String propertyId)Check a property.booleangetFeature(java.lang.String featureId)Returns the state of a feature.java.lang.ObjectgetProperty(java.lang.String propertyId)Returns the value of a property.voidsetFeature(java.lang.String featureId, boolean state)Set the state of a feature.voidsetProperty(java.lang.String propertyId, java.lang.Object value)setProperty
-
-
-
Field Detail
-
PARSER_SETTINGS
protected static final java.lang.String PARSER_SETTINGS
- See Also:
- Constant Field Values
-
fRecognizedProperties
protected java.util.ArrayList fRecognizedProperties
Recognized properties.
-
fProperties
protected java.util.HashMap fProperties
Properties.
-
fRecognizedFeatures
protected java.util.ArrayList fRecognizedFeatures
Recognized features.
-
fFeatures
protected java.util.HashMap fFeatures
Features.
-
fParentSettings
protected org.apache.xerces.xni.parser.XMLComponentManager fParentSettings
Parent parser configuration settings.
-
-
Constructor Detail
-
ParserConfigurationSettings
public ParserConfigurationSettings()
Default Constructor.
-
ParserConfigurationSettings
public ParserConfigurationSettings(org.apache.xerces.xni.parser.XMLComponentManager parent)
Constructs a parser configuration settings object with a parent settings object.
-
-
Method Detail
-
addRecognizedFeatures
public void addRecognizedFeatures(java.lang.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.
-
setFeature
public void setFeature(java.lang.String featureId, boolean state) throws org.apache.xerces.xni.parser.XMLConfigurationExceptionSet 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:
org.apache.xerces.xni.parser.XMLConfigurationException- If the requested feature is not known.
-
addRecognizedProperties
public void addRecognizedProperties(java.lang.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.
-
setProperty
public void setProperty(java.lang.String propertyId, java.lang.Object value) throws org.apache.xerces.xni.parser.XMLConfigurationExceptionsetProperty- Parameters:
propertyId-value-- Throws:
org.apache.xerces.xni.parser.XMLConfigurationException- If the requested feature is not known.
-
getFeature
public boolean getFeature(java.lang.String featureId) throws org.apache.xerces.xni.parser.XMLConfigurationExceptionReturns the state of a feature.- Specified by:
getFeaturein interfaceorg.apache.xerces.xni.parser.XMLComponentManager- Parameters:
featureId- The feature identifier.- Returns:
- true if the feature is supported
- Throws:
org.apache.xerces.xni.parser.XMLConfigurationException- Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
-
getProperty
public java.lang.Object getProperty(java.lang.String propertyId) throws org.apache.xerces.xni.parser.XMLConfigurationExceptionReturns the value of a property.- Specified by:
getPropertyin interfaceorg.apache.xerces.xni.parser.XMLComponentManager- Parameters:
propertyId- The property identifier.- Returns:
- the value of the property
- Throws:
org.apache.xerces.xni.parser.XMLConfigurationException- Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
-
checkFeature
protected void checkFeature(java.lang.String featureId) throws org.apache.xerces.xni.parser.XMLConfigurationExceptionCheck 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:
org.apache.xerces.xni.parser.XMLConfigurationException- If the requested feature is not known.
-
checkProperty
protected void checkProperty(java.lang.String propertyId) throws org.apache.xerces.xni.parser.XMLConfigurationExceptionCheck 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:
org.apache.xerces.xni.parser.XMLConfigurationException- If the requested feature is not known.
-
-