Exemplo n.º 1
0
 public synchronized boolean getFeature(String name)
     throws SAXNotRecognizedException, SAXNotSupportedException {
   if (name == null) {
     // TODO: Add localized error message.
     throw new NullPointerException();
   }
   if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
     return fSecurityManager.isSecureProcessing();
   }
   return super.getFeature(name);
 }
 /**
  * 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 FeatureState getFeatureState(String featureId) throws XMLConfigurationException {
   if (PARSER_SETTINGS.equals(featureId)) {
     return FeatureState.is(fConfigUpdated);
   } else if (VALIDATION.equals(featureId) || SCHEMA_VALIDATION.equals(featureId)) {
     return FeatureState.is(true);
   } else if (USE_GRAMMAR_POOL_ONLY.equals(featureId)) {
     return FeatureState.is(fUseGrammarPoolOnly);
   } else if (XMLConstants.FEATURE_SECURE_PROCESSING.equals(featureId)) {
     return FeatureState.is(fInitSecurityManager.isSecureProcessing());
   } else if (SCHEMA_ELEMENT_DEFAULT.equals(featureId)) {
     return FeatureState.is(
         true); // pre-condition: VALIDATION and SCHEMA_VALIDATION are always true
   }
   return super.getFeatureState(featureId);
 }