Methods Summary |
---|
public void | addRecognizedFeatures(java.lang.String[] featureIds)Allows a parser to add parser specific features to be recognized
and managed by the parser configuration.
// add recognized features
int featureIdsCount = featureIds != null ? featureIds.length : 0;
for (int i = 0; i < featureIdsCount; i++) {
String featureId = featureIds[i];
if (!fRecognizedFeatures.contains(featureId)) {
fRecognizedFeatures.add(featureId);
}
}
|
public void | addRecognizedProperties(java.lang.String[] propertyIds)Allows a parser to add parser specific properties to be recognized
and managed by the parser configuration.
// add recognizedProperties
int propertyIdsCount = propertyIds != null ? propertyIds.length : 0;
for (int i = 0; i < propertyIdsCount; i++) {
String propertyId = propertyIds[i];
if (!fRecognizedProperties.contains(propertyId)) {
fRecognizedProperties.add(propertyId);
}
}
|
protected void | checkFeature(java.lang.String featureId)Check a feature. If feature is known and supported, this method simply
returns. Otherwise, the appropriate exception is thrown.
// check feature
if (!fRecognizedFeatures.contains(featureId)) {
if (fParentSettings != null) {
fParentSettings.getFeature(featureId);
}
else {
short type = XMLConfigurationException.NOT_RECOGNIZED;
throw new XMLConfigurationException(type, featureId);
}
}
|
protected void | checkProperty(java.lang.String propertyId)Check a property. If the property is known and supported, this method
simply returns. Otherwise, the appropriate exception is thrown.
// check property
if (!fRecognizedProperties.contains(propertyId)) {
if (fParentSettings != null) {
fParentSettings.getProperty(propertyId);
}
else {
short type = XMLConfigurationException.NOT_RECOGNIZED;
throw new XMLConfigurationException(type, propertyId);
}
}
|
public boolean | getFeature(java.lang.String featureId)Returns the state of a feature.
Boolean state = (Boolean) fFeatures.get(featureId);
if (state == null) {
checkFeature(featureId);
return false;
}
return state.booleanValue();
|
public java.lang.Object | getProperty(java.lang.String propertyId)Returns the value of a property.
Object propertyValue = fProperties.get(propertyId);
if (propertyValue == null) {
checkProperty(propertyId);
}
return propertyValue;
|
public void | setFeature(java.lang.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.
// check and store
checkFeature(featureId);
fFeatures.put(featureId, state ? Boolean.TRUE : Boolean.FALSE);
|
public void | setProperty(java.lang.String propertyId, java.lang.Object value)setProperty
// check and store
checkProperty(propertyId);
if(value == null){
fProperties.remove(propertyId);
}else
fProperties.put(propertyId, value);
|