/** * 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. * * @param featureId The unique identifier (URI) of the feature. * @param state The requested state of the feature (true or false). * * @exception org.apache.xerces.xni.parser.XMLConfigurationException If the * requested feature is not known. */ public void setFeature(String featureId, boolean state) throws XMLConfigurationException { // save state if noone "objects" super.setFeature(featureId, state); } // setFeature(String,boolean)
/** * setProperty * * @param propertyId * @param value */ public void setProperty(String propertyId, Object value) throws XMLConfigurationException { // store value if noone "objects" super.setProperty(propertyId, value); } // setProperty(String,Object)
private void copyFeatures1( Enumeration features, String featurePrefix, XMLComponentManager from, ParserConfigurationSettings to) { while (features.hasMoreElements()) { String featureId = featurePrefix + (String)features.nextElement(); to.addRecognizedFeatures(new String[] { featureId }); try { to.setFeature(featureId, from.getFeature(featureId)); } catch (XMLConfigurationException e) { // componentManager doesn't support this feature, // so we won't worry about it } } }
Boolean.FALSE, }; addRecognizedFeatures(featureNames); for (int i = 0; i < featureNames.length; i++) { Boolean featureValue = featureValues[i]; if (featureValue != null) { String featureName = featureNames[i]; setFeature(featureName, featureValue.booleanValue()); Locale.getDefault(), }; addRecognizedProperties(propertyNames); for (int i = 0; i < propertyNames.length; i++) { Object propertyValue = propertyValues[i]; if (propertyValue != null) { String propertyName = propertyNames[i]; setProperty(propertyName, propertyValue); "http://apache.org/xml/features/scanner/notify-builtin-refs", }; addRecognizedFeatures(recognizedFeatures); SYMBOL_TABLE, }; addRecognizedProperties(recognizedProperties); Object symbolTable = ObjectFactory.createObject("org.apache.xerces.util.SymbolTable", "org.apache.xerces.util.SymbolTable"); setProperty(SYMBOL_TABLE, symbolTable);
String name = (String) entry.getKey(); boolean value = ((Boolean) entry.getValue()).booleanValue(); super.setFeature(name, value); String name = (String) entry.getKey(); Object value = entry.getValue(); super.setProperty(name, value);
fInitProperties.put(propertyId, super.getProperty(propertyId)); super.setProperty(propertyId, value);
fSchemaValidator.setFeature(featureId, value); if (!fInitFeatures.containsKey(featureId)) { boolean current = super.getFeature(featureId); fInitFeatures.put(featureId, current ? Boolean.TRUE : Boolean.FALSE); super.setFeature(featureId, value);
fSettings = new ParserConfigurationSettings(); copyFeatures(componentManager, fSettings); fSettings.setFeature(SCHEMA_VALIDATION, false); fSettings.setFeature(VALIDATION, false); fSettings.setFeature(DYNAMIC_VALIDATION, true);
/** * Returns the state of a property. * * @param propertyId The property identifier. * * @throws XMLConfigurationException Thrown on configuration error. */ public Object getProperty(String propertyId) throws XMLConfigurationException { return fLoaderConfig.getProperty(propertyId); } // getProperty(String): Object
fLoaderConfig.addRecognizedFeatures(RECOGNIZED_FEATURES); fLoaderConfig.addRecognizedProperties(RECOGNIZED_PROPERTIES); if (symbolTable != null){ fLoaderConfig.setProperty(SYMBOL_TABLE, symbolTable); fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter()); fLoaderConfig.setProperty(ERROR_REPORTER, fErrorReporter); fEntityManager = entityResolver; fLoaderConfig.setProperty(ENTITY_MANAGER, fEntityManager); fLoaderConfig.setFeature(AUGMENT_PSVI, true);
Boolean state = component.getFeatureDefault(featureId); if (state != null) { super.setFeature(featureId, state.booleanValue()); Object value = component.getPropertyDefault(propertyId); if (value != null) { super.setProperty(propertyId, value);
/** Returns the locale. */ public Locale getLocale() { Locale locale = null; try { locale = (Locale)getProperty(LOCALE); fErrorReporter.setLocale(locale); } catch (Exception e) { // ignore } return locale; } // getLocale():Locale
/** Sets the locale. */ public void setLocale(Locale locale) { try { setProperty(LOCALE, locale); } catch (Exception e) { // ignore } } // setLocale(Locale)
/** * Sets the state of a feature. This method is called by the component * manager any time after reset when a feature changes state. * <p> * <strong>Note:</strong> Components should silently ignore features * that do not affect the operation of the component. * * @param featureId The feature identifier. * @param state The state of the feature. * * @throws SAXNotRecognizedException The component should not throw * this exception. * @throws SAXNotSupportedException The component should not throw * this exception. */ public void setFeature(String featureId, boolean state) throws XMLConfigurationException { if (featureId.equals(ALLOW_UE_AND_NOTATION_EVENTS)) { fSendUEAndNotationEvents = state; } if (fSettings != null) { fNeedCopyFeatures = true; fSettings.setFeature(featureId, state); } } // setFeature(String,boolean)
/** * Returns the value of a property. * * @param propertyId The property identifier. * @return the value of the property * * @throws XMLConfigurationException Thrown for configuration error. * In general, components should * only throw this exception if * it is <strong>really</strong> * a critical error. */ public Object getProperty(String propertyId) throws XMLConfigurationException { if (LOCALE.equals(propertyId)) { return getLocale(); } return super.getProperty(propertyId); }
/** Sets the entity resolver. */ public void setEntityResolver(XMLEntityResolver resolver) { setProperty(ENTITY_RESOLVER, fEntityResolver = resolver); } // setEntityResolver(XMLEntityResolver)
/** Sets a feature. */ public void setFeature(String featureId, boolean state) throws XMLConfigurationException { super.setFeature(featureId, state); int size = fHTMLComponents.size(); for (int i = 0; i < size; i++) { HTMLComponent component = (HTMLComponent)fHTMLComponents.elementAt(i); component.setFeature(featureId, state); } } // setFeature(String,boolean)
/** * Returns the value of a property. * * @param propertyId The property identifier. * @return the value of the property * * @throws XMLConfigurationException Thrown for configuration error. * In general, components should * only throw this exception if * it is <strong>really</strong> * a critical error. */ public Object getProperty(String propertyId) throws XMLConfigurationException { if (LOCALE.equals(propertyId)) { return getLocale(); } else if (XML_SCHEMA_VERSION.equals(propertyId)) { return fXSDVersion; } final Object component = fComponents.get(propertyId); if (component != null) { return component; } else if (fComponents.containsKey(propertyId)) { return null; } return super.getProperty(propertyId); }
/** * Sets the entity resolver. * * @param entityResolver The new entity resolver. */ public void setEntityResolver(XMLEntityResolver entityResolver) { fUserEntityResolver = entityResolver; fLoaderConfig.setProperty(ENTITY_RESOLVER, entityResolver); fEntityManager.setProperty(ENTITY_RESOLVER, entityResolver); } // setEntityResolver(XMLEntityResolver)
/** * Sets a feature. */ public void setFeature(String featureId, boolean state) throws XMLConfigurationException { super.setFeature(featureId, state); int size = fHTMLComponents.size(); for (int i = 0; i < size; i++) { HTMLComponent component = (HTMLComponent) fHTMLComponents.elementAt(i); component.setFeature(featureId, state); } } // setFeature(String,boolean)