/** * Set the state of a feature. * * <p>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. * * @param featureId The unique identifier (URI) of the feature. * @param state The requested state of the feature (true or false). * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the * requested feature is not known. */ public void setFeature(String featureId, boolean state) throws XMLConfigurationException { // check and store checkFeature(featureId); fFeatures.put(featureId, state ? Boolean.TRUE : Boolean.FALSE); } // setFeature(String,boolean)
/** * Returns the state of a feature. * * @param featureId The feature identifier. * @return true if the feature is supported * @throws XMLConfigurationException Thrown for configuration error. In general, components should * only throw this exception if it is <strong>really</strong> a critical error. */ public boolean getFeature(String featureId) throws XMLConfigurationException { Boolean state = (Boolean) fFeatures.get(featureId); if (state == null) { checkFeature(featureId); return false; } return state.booleanValue(); } // getFeature(String):boolean