/** * Reset all components before parsing. * * @throws XNIException Thrown if an error occurs during initialization. */ protected void reset() throws XNIException { if (fValidationManager != null) fValidationManager.reset(); // configure the pipeline and initialize the components configurePipeline(); super.reset(); } // reset()
/** * Check a property. If the property is know and supported, this method simply returns. Otherwise, * the appropriate exception is thrown. * * @param propertyId The unique identifier (URI) of the property being set. * @throws XMLConfigurationException Thrown for configuration error. In general, components should * only throw this exception if it is <strong>really</strong> a critical error. */ protected void checkProperty(String propertyId) throws XMLConfigurationException { // // Xerces Properties // if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length(); if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() && propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) { return; } } if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length(); if (suffixLength == Constants.SCHEMA_SOURCE.length() && propertyId.endsWith(Constants.SCHEMA_SOURCE)) { return; } } // // Not recognized // super.checkProperty(propertyId); } // checkProperty(String)
public void setProperty(String propertyId, Object value) throws XMLConfigurationException { fConfigUpdated = true; if (LOCALE.equals(propertyId)) { setLocale((Locale) value); } super.setProperty(propertyId, value); }
/** * Check a feature. If feature is know and supported, this method simply returns. Otherwise, the * appropriate exception is thrown. * * @param featureId The unique identifier (URI) of the feature. * @throws XMLConfigurationException Thrown for configuration error. In general, components should * only throw this exception if it is <strong>really</strong> a critical error. */ protected void checkFeature(String featureId) throws XMLConfigurationException { // // Xerces Features // if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) { final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length(); // // http://apache.org/xml/features/validation/dynamic // Allows the parser to validate a document only when it // contains a grammar. Validation is turned on/off based // on each document instance, automatically. // if (suffixLength == Constants.DYNAMIC_VALIDATION_FEATURE.length() && featureId.endsWith(Constants.DYNAMIC_VALIDATION_FEATURE)) { return; } // // http://apache.org/xml/features/validation/default-attribute-values // if (suffixLength == Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE.length() && featureId.endsWith(Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE)) { // REVISIT short type = XMLConfigurationException.NOT_SUPPORTED; throw new XMLConfigurationException(type, featureId); } // // http://apache.org/xml/features/validation/default-attribute-values // if (suffixLength == Constants.VALIDATE_CONTENT_MODELS_FEATURE.length() && featureId.endsWith(Constants.VALIDATE_CONTENT_MODELS_FEATURE)) { // REVISIT short type = XMLConfigurationException.NOT_SUPPORTED; throw new XMLConfigurationException(type, featureId); } // // http://apache.org/xml/features/validation/nonvalidating/load-dtd-grammar // if (suffixLength == Constants.LOAD_DTD_GRAMMAR_FEATURE.length() && featureId.endsWith(Constants.LOAD_DTD_GRAMMAR_FEATURE)) { return; } // // http://apache.org/xml/features/validation/nonvalidating/load-external-dtd // if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() && featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) { return; } // // http://apache.org/xml/features/validation/default-attribute-values // if (suffixLength == Constants.VALIDATE_DATATYPES_FEATURE.length() && featureId.endsWith(Constants.VALIDATE_DATATYPES_FEATURE)) { short type = XMLConfigurationException.NOT_SUPPORTED; throw new XMLConfigurationException(type, featureId); } } // // Not recognized // super.checkFeature(featureId); } // checkFeature(String)
/** * Set the locale to use for messages. * * @param locale The locale object to use for localization of messages. * @exception XNIException Thrown if the parser does not support the specified locale. */ public void setLocale(Locale locale) throws XNIException { super.setLocale(locale); fErrorReporter.setLocale(locale); } // setLocale(Locale)
public void setProperty(String propertyId, Object value) throws XMLConfigurationException { fConfigUpdated = true; super.setProperty(propertyId, value); }
// // Public methods // public void setFeature(String featureId, boolean state) throws XMLConfigurationException { fConfigUpdated = true; super.setFeature(featureId, state); }