com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool Java Examples
The following examples show how to use
com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SAXParser.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Constructs a SAX parser using the specified symbol table and * grammar pool. */ public SAXParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super(new XIncludeAwareParserConfiguration()); // set features fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); fConfiguration.setFeature(NOTIFY_BUILTIN_REFS, true); // set properties fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); if (symbolTable != null) { fConfiguration.setProperty(SYMBOL_TABLE, symbolTable); } if (grammarPool != null) { fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool); } }
Example #2
Source File: XMLGrammarCachingConfiguration.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
/** * Constructs a parser configuration using the specified symbol table, * grammar pool, and parent settings. * <p> * <strong>REVISIT:</strong> * Grammar pool will be updated when the new validation engine is * implemented. * * @param symbolTable The symbol table to use. * @param grammarPool The grammar pool to use. * @param parentSettings The parent settings. */ public XMLGrammarCachingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { super(symbolTable, grammarPool, parentSettings); // REVISIT: may need to add some features/properties // specific to this configuration at some point... // add default recognized features // set state for default features // add default recognized properties // create and register missing components fSchemaLoader = new XMLSchemaLoader(fSymbolTable); fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool); // and set up the DTD loader too: fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool); }
Example #3
Source File: SAXParser.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
/** * Constructs a SAX parser using the specified symbol table and * grammar pool. */ public SAXParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super(new XIncludeAwareParserConfiguration()); // set features fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); fConfiguration.setFeature(NOTIFY_BUILTIN_REFS, true); // set properties fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); if (symbolTable != null) { fConfiguration.setProperty(SYMBOL_TABLE, symbolTable); } if (grammarPool != null) { fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool); } }
Example #4
Source File: XMLGrammarCachingConfiguration.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Constructs a parser configuration using the specified symbol table, * grammar pool, and parent settings. * <p> * <strong>REVISIT:</strong> * Grammar pool will be updated when the new validation engine is * implemented. * * @param symbolTable The symbol table to use. * @param grammarPool The grammar pool to use. * @param parentSettings The parent settings. */ public XMLGrammarCachingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { super(symbolTable, grammarPool, parentSettings); // REVISIT: may need to add some features/properties // specific to this configuration at some point... // add default recognized features // set state for default features // add default recognized properties // create and register missing components fSchemaLoader = new XMLSchemaLoader(fSymbolTable); fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool); // and set up the DTD loader too: fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool); }
Example #5
Source File: DOMParser.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Constructs a DOM parser using the specified symbol table and * grammar pool. */ public DOMParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super(new XIncludeAwareParserConfiguration()); // set properties fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); if (symbolTable != null) { fConfiguration.setProperty(SYMBOL_TABLE, symbolTable); } if (grammarPool != null) { fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool); } fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); }
Example #6
Source File: DOMParser.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
/** * Constructs a DOM parser using the specified symbol table and * grammar pool. */ public DOMParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super(new XIncludeAwareParserConfiguration()); // set properties fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); if (symbolTable != null) { fConfiguration.setProperty(SYMBOL_TABLE, symbolTable); } if (grammarPool != null) { fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool); } fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); }
Example #7
Source File: DOMParserImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Constructs a DOM Builder using the specified symbol table and * grammar pool. */ public DOMParserImpl (SymbolTable symbolTable, XMLGrammarPool grammarPool) { this (new XIncludeAwareParserConfiguration()); fConfiguration.setProperty ( Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY, symbolTable); fConfiguration.setProperty ( Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY, grammarPool); }
Example #8
Source File: XMLDocumentParser.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Constructs a document parser using the specified symbol table and * grammar pool. */ public XMLDocumentParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super(new XIncludeAwareParserConfiguration()); fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY, symbolTable); fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.XMLGRAMMAR_POOL_PROPERTY, grammarPool); }
Example #9
Source File: XIncludeAwareParserConfiguration.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Constructs a parser configuration using the specified symbol table, * grammar pool, and parent settings. * <p> * * @param symbolTable The symbol table to use. * @param grammarPool The grammar pool to use. * @param parentSettings The parent settings. */ public XIncludeAwareParserConfiguration( SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { super(symbolTable, grammarPool, parentSettings); final String[] recognizedFeatures = { ALLOW_UE_AND_NOTATION_EVENTS, XINCLUDE_FIXUP_BASE_URIS, XINCLUDE_FIXUP_LANGUAGE }; addRecognizedFeatures(recognizedFeatures); // add default recognized properties final String[] recognizedProperties = { XINCLUDE_HANDLER, NAMESPACE_CONTEXT }; addRecognizedProperties(recognizedProperties); setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true); setFeature(XINCLUDE_FIXUP_BASE_URIS, true); setFeature(XINCLUDE_FIXUP_LANGUAGE, true); fNonXIncludeNSContext = new NamespaceSupport(); fCurrentNSContext = fNonXIncludeNSContext; setProperty(NAMESPACE_CONTEXT, fNonXIncludeNSContext); }
Example #10
Source File: CachingParserPool.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** Creates a new DOM parser. */ public DOMParser createDOMParser() { SymbolTable symbolTable = fShadowSymbolTable ? new ShadowedSymbolTable(fSynchronizedSymbolTable) : fSynchronizedSymbolTable; XMLGrammarPool grammarPool = fShadowGrammarPool ? new ShadowedGrammarPool(fSynchronizedGrammarPool) : fSynchronizedGrammarPool; return new DOMParser(symbolTable, grammarPool); }
Example #11
Source File: CachingParserPool.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** Creates a new SAX parser. */ public SAXParser createSAXParser() { SymbolTable symbolTable = fShadowSymbolTable ? new ShadowedSymbolTable(fSynchronizedSymbolTable) : fSynchronizedSymbolTable; XMLGrammarPool grammarPool = fShadowGrammarPool ? new ShadowedGrammarPool(fSynchronizedGrammarPool) : fSynchronizedGrammarPool; return new SAXParser(symbolTable, grammarPool); }
Example #12
Source File: IntegratedParserConfiguration.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Constructs a parser configuration using the specified symbol table, * grammar pool, and parent settings. * <p> * <strong>REVISIT:</strong> * Grammar pool will be updated when the new validation engine is * implemented. * * @param symbolTable The symbol table to use. * @param grammarPool The grammar pool to use. * @param parentSettings The parent settings. */ public IntegratedParserConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { super(symbolTable, grammarPool, parentSettings); // create components fNonNSScanner = new XMLDocumentScannerImpl(); fNonNSDTDValidator = new XMLDTDValidator(); // add components addComponent((XMLComponent)fNonNSScanner); addComponent((XMLComponent)fNonNSDTDValidator); }
Example #13
Source File: XMLDTDLoader.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Sets the value of a property. This method is called by the component * manager any time after reset when a property changes value. * <p> * <strong>Note:</strong> Components should silently ignore properties * that do not affect the operation of the component. * * @param propertyId The property identifier. * @param value The value of the property. * * @throws SAXNotRecognizedException The component should not throw * this exception. * @throws SAXNotSupportedException The component should not throw * this exception. */ public void setProperty(String propertyId, Object value) throws XMLConfigurationException { if (propertyId.equals(SYMBOL_TABLE)) { fSymbolTable = (SymbolTable)value; fDTDScanner.setProperty(propertyId, value); fEntityManager.setProperty(propertyId, value); } else if(propertyId.equals(ERROR_REPORTER)) { fErrorReporter = (XMLErrorReporter)value; // Add XML message formatter if there isn't one. if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) { XMLMessageFormatter xmft = new XMLMessageFormatter(); fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft); fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft); } fDTDScanner.setProperty(propertyId, value); fEntityManager.setProperty(propertyId, value); } else if (propertyId.equals(ERROR_HANDLER)) { fErrorReporter.setProperty(propertyId, value); } else if (propertyId.equals(ENTITY_RESOLVER)) { fEntityResolver = (XMLEntityResolver)value; fEntityManager.setProperty(propertyId, value); } else if (propertyId.equals(LOCALE)) { setLocale((Locale) value); } else if(propertyId.equals(GRAMMAR_POOL)) { fGrammarPool = (XMLGrammarPool)value; } else { throw new XMLConfigurationException(Status.NOT_RECOGNIZED, propertyId); } }
Example #14
Source File: XMLSchemaLoader.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Sets the state of a property. * * @param propertyId The property identifier. * @param state The state of the property. * * @throws XMLConfigurationException Thrown when a property is not * recognized or cannot be set. */ public void setProperty(String propertyId, Object state) throws XMLConfigurationException { fSettingsChanged = true; fLoaderConfig.setProperty(propertyId, state); if (propertyId.equals(JAXP_SCHEMA_SOURCE)) { fJAXPSource = state; fJAXPProcessed = false; } else if (propertyId.equals(XMLGRAMMAR_POOL)) { fGrammarPool = (XMLGrammarPool)state; } else if (propertyId.equals(SCHEMA_LOCATION)) { fExternalSchemas = (String)state; } else if (propertyId.equals(SCHEMA_NONS_LOCATION)) { fExternalNoNSSchema = (String) state; } else if (propertyId.equals(LOCALE)) { setLocale((Locale) state); } else if (propertyId.equals(ENTITY_RESOLVER)) { fEntityManager.setProperty(ENTITY_RESOLVER, state); } else if (propertyId.equals(ERROR_REPORTER)) { fErrorReporter = (XMLErrorReporter)state; if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) { fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter()); } } else if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER)) { XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)state; faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA); } }
Example #15
Source File: XIncludeAwareParserConfiguration.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Constructs a parser configuration using the specified symbol table, * grammar pool, and parent settings. * <p> * * @param symbolTable The symbol table to use. * @param grammarPool The grammar pool to use. * @param parentSettings The parent settings. */ public XIncludeAwareParserConfiguration( SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { super(symbolTable, grammarPool, parentSettings); final String[] recognizedFeatures = { ALLOW_UE_AND_NOTATION_EVENTS, XINCLUDE_FIXUP_BASE_URIS, XINCLUDE_FIXUP_LANGUAGE }; addRecognizedFeatures(recognizedFeatures); // add default recognized properties final String[] recognizedProperties = { XINCLUDE_HANDLER, NAMESPACE_CONTEXT }; addRecognizedProperties(recognizedProperties); setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true); setFeature(XINCLUDE_FIXUP_BASE_URIS, true); setFeature(XINCLUDE_FIXUP_LANGUAGE, true); fNonXIncludeNSContext = new NamespaceSupport(); fCurrentNSContext = fNonXIncludeNSContext; setProperty(NAMESPACE_CONTEXT, fNonXIncludeNSContext); }
Example #16
Source File: DOMParserImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Constructs a DOM Builder using the specified symbol table and * grammar pool. */ public DOMParserImpl (SymbolTable symbolTable, XMLGrammarPool grammarPool) { this (new XIncludeAwareParserConfiguration()); fConfiguration.setProperty ( Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY, symbolTable); fConfiguration.setProperty ( Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY, grammarPool); }
Example #17
Source File: CachingParserPool.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** Creates a new DOM parser. */ public DOMParser createDOMParser() { SymbolTable symbolTable = fShadowSymbolTable ? new ShadowedSymbolTable(fSynchronizedSymbolTable) : fSynchronizedSymbolTable; XMLGrammarPool grammarPool = fShadowGrammarPool ? new ShadowedGrammarPool(fSynchronizedGrammarPool) : fSynchronizedGrammarPool; return new DOMParser(symbolTable, grammarPool); }
Example #18
Source File: XMLDocumentParser.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Constructs a document parser using the specified symbol table and * grammar pool. */ public XMLDocumentParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super(new XIncludeAwareParserConfiguration()); fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY, symbolTable); fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.XMLGRAMMAR_POOL_PROPERTY, grammarPool); }
Example #19
Source File: IntegratedParserConfiguration.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Constructs a parser configuration using the specified symbol table, * grammar pool, and parent settings. * <p> * <strong>REVISIT:</strong> * Grammar pool will be updated when the new validation engine is * implemented. * * @param symbolTable The symbol table to use. * @param grammarPool The grammar pool to use. * @param parentSettings The parent settings. */ public IntegratedParserConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { super(symbolTable, grammarPool, parentSettings); // create components fNonNSScanner = new XMLDocumentScannerImpl(); fNonNSDTDValidator = new XMLDTDValidator(); // add components addComponent((XMLComponent)fNonNSScanner); addComponent((XMLComponent)fNonNSDTDValidator); }
Example #20
Source File: XPointerParserConfiguration.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Constructs a parser configuration using the specified symbol table, * grammar pool, and parent settings. * <p> * * @param symbolTable The symbol table to use. * @param grammarPool The grammar pool to use. * @param parentSettings The parent settings. */ public XPointerParserConfiguration( SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { super(symbolTable, grammarPool, parentSettings); fXIncludeHandler = new XIncludeHandler(); addCommonComponent(fXIncludeHandler); fXPointerHandler = new XPointerHandler(); addCommonComponent(fXPointerHandler); final String[] recognizedFeatures = { ALLOW_UE_AND_NOTATION_EVENTS, XINCLUDE_FIXUP_BASE_URIS, XINCLUDE_FIXUP_LANGUAGE }; addRecognizedFeatures(recognizedFeatures); // add default recognized properties final String[] recognizedProperties = { XINCLUDE_HANDLER, XPOINTER_HANDLER, NAMESPACE_CONTEXT }; addRecognizedProperties(recognizedProperties); setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true); setFeature(XINCLUDE_FIXUP_BASE_URIS, true); setFeature(XINCLUDE_FIXUP_LANGUAGE, true); setProperty(XINCLUDE_HANDLER, fXIncludeHandler); setProperty(XPOINTER_HANDLER, fXPointerHandler); setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport()); }
Example #21
Source File: XMLDTDLoader.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Sets the value of a property. This method is called by the component * manager any time after reset when a property changes value. * <p> * <strong>Note:</strong> Components should silently ignore properties * that do not affect the operation of the component. * * @param propertyId The property identifier. * @param value The value of the property. * * @throws SAXNotRecognizedException The component should not throw * this exception. * @throws SAXNotSupportedException The component should not throw * this exception. */ public void setProperty(String propertyId, Object value) throws XMLConfigurationException { if (propertyId.equals(SYMBOL_TABLE)) { fSymbolTable = (SymbolTable)value; fDTDScanner.setProperty(propertyId, value); fEntityManager.setProperty(propertyId, value); } else if(propertyId.equals(ERROR_REPORTER)) { fErrorReporter = (XMLErrorReporter)value; // Add XML message formatter if there isn't one. if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) { XMLMessageFormatter xmft = new XMLMessageFormatter(); fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft); fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft); } fDTDScanner.setProperty(propertyId, value); fEntityManager.setProperty(propertyId, value); } else if (propertyId.equals(ERROR_HANDLER)) { fErrorReporter.setProperty(propertyId, value); } else if (propertyId.equals(ENTITY_RESOLVER)) { fEntityResolver = (XMLEntityResolver)value; fEntityManager.setProperty(propertyId, value); } else if (propertyId.equals(LOCALE)) { setLocale((Locale) value); } else if(propertyId.equals(GRAMMAR_POOL)) { fGrammarPool = (XMLGrammarPool)value; } else { throw new XMLConfigurationException(Status.NOT_RECOGNIZED, propertyId); } }
Example #22
Source File: XMLDTDProcessor.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { boolean parser_settings = componentManager.getFeature(PARSER_SETTINGS, true); if (!parser_settings) { // parser settings have not been changed reset(); return; } // sax features fValidation = componentManager.getFeature(VALIDATION, false); fDTDValidation = !(componentManager .getFeature( Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE, false)); // Xerces features fWarnDuplicateAttdef = componentManager.getFeature(WARN_ON_DUPLICATE_ATTDEF, false); fWarnOnUndeclaredElemdef = componentManager.getFeature(WARN_ON_UNDECLARED_ELEMDEF, false); // get needed components fErrorReporter = (XMLErrorReporter) componentManager.getProperty( Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY); fSymbolTable = (SymbolTable) componentManager.getProperty( Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY); fGrammarPool = (XMLGrammarPool) componentManager.getProperty(GRAMMAR_POOL, null); try { fValidator = (XMLDTDValidator) componentManager.getProperty(DTD_VALIDATOR, null); } catch (ClassCastException e) { fValidator = null; } // we get our grammarBucket from the validator... if (fValidator != null) { fGrammarBucket = fValidator.getGrammarBucket(); } else { fGrammarBucket = null; } reset(); }
Example #23
Source File: XMLSchema.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** Constructor */ public XMLSchema(XMLGrammarPool grammarPool) { fGrammarPool = grammarPool; }
Example #24
Source File: XML11DTDProcessor.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
public XML11DTDProcessor(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super(symbolTable, grammarPool); }
Example #25
Source File: XMLGrammarPreparser.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** Returns the registered grammar pool. */ public XMLGrammarPool getGrammarPool() { return fGrammarPool; }
Example #26
Source File: EmptyXMLSchema.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public XMLGrammarPool getGrammarPool() { return this; }
Example #27
Source File: ReadOnlyGrammarPool.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
public ReadOnlyGrammarPool( XMLGrammarPool pool ) { this.core = pool; }
Example #28
Source File: XMLDTDLoader.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
public XMLDTDLoader(SymbolTable symbolTable, XMLGrammarPool grammarPool) { this(symbolTable, grammarPool, null, new XMLEntityManager()); }
Example #29
Source File: EmptyXMLSchema.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
public XMLGrammarPool getGrammarPool() { return this; }
Example #30
Source File: XMLDTDProcessor.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { boolean parser_settings = componentManager.getFeature(PARSER_SETTINGS, true); if (!parser_settings) { // parser settings have not been changed reset(); return; } // sax features fValidation = componentManager.getFeature(VALIDATION, false); fDTDValidation = !(componentManager .getFeature( Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE, false)); // Xerces features fWarnDuplicateAttdef = componentManager.getFeature(WARN_ON_DUPLICATE_ATTDEF, false); fWarnOnUndeclaredElemdef = componentManager.getFeature(WARN_ON_UNDECLARED_ELEMDEF, false); // get needed components fErrorReporter = (XMLErrorReporter) componentManager.getProperty( Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY); fSymbolTable = (SymbolTable) componentManager.getProperty( Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY); fGrammarPool = (XMLGrammarPool) componentManager.getProperty(GRAMMAR_POOL, null); try { fValidator = (XMLDTDValidator) componentManager.getProperty(DTD_VALIDATOR, null); } catch (ClassCastException e) { fValidator = null; } // we get our grammarBucket from the validator... if (fValidator != null) { fGrammarBucket = fValidator.getGrammarBucket(); } else { fGrammarBucket = null; } reset(); }