Java Code Examples for com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager#getProperty()

The following examples show how to use com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager#getProperty() . 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: XMLEntityScanner.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Resets the component. The component can query the component manager
 * about any features and properties that affect the operation of the
 * component.
 *
 * @param componentManager The component manager.
 *
 * @throws SAXException Thrown by component on initialization error.
 *                      For example, if a feature or property is
 *                      required for the operation of the component, the
 *                      component manager may throw a
 *                      SAXNotRecognizedException or a
 *                      SAXNotSupportedException.
 */
public void reset(XMLComponentManager componentManager)
throws XMLConfigurationException {

    //System.out.println(" this is being called");
    // xerces features
    fAllowJavaEncodings = componentManager.getFeature(ALLOW_JAVA_ENCODINGS, false);

    //xerces properties
    fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    fCurrentEntity = null;
    whiteSpaceLen = 0;
    whiteSpaceInfoNeeded = true;
    listeners.clear();
}
 
Example 2
Source File: JAXPValidatorComponent.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException {
    // obtain references from the manager
    fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    try {
        fEntityResolver = (XMLEntityResolver) componentManager.getProperty(ENTITY_MANAGER);
    }
    catch (XMLConfigurationException e) {
        fEntityResolver = null;
    }
}
 
Example 3
Source File: DTDGrammarUtil.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void reset(XMLComponentManager componentManager)
throws XMLConfigurationException {

    fDTDGrammar = null;
    fInElementContent = false;
    fCurrentElementIndex = -1;
    fCurrentContentSpecType = -1;
    fNamespaces = componentManager.getFeature(NAMESPACES, true);
    fSymbolTable = (SymbolTable) componentManager.getProperty(
            Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);
    fElementDepth = -1;
}
 
Example 4
Source File: CMNodeFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void reset(XMLComponentManager componentManager){
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    try {
        fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER);
        //we are setting the limit of number of nodes to 3times the maxOccur value..
        if(fSecurityManager != null){
            maxNodeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT) * MULTIPLICITY ;
        }
    }
    catch (XMLConfigurationException e) {
        fSecurityManager = null;
    }

}
 
Example 5
Source File: CMNodeFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void reset(XMLComponentManager componentManager){
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    try {
        fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER);
        //we are setting the limit of number of nodes to 3times the maxOccur value..
        if(fSecurityManager != null){
            maxNodeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT) * MULTIPLICITY ;
        }
    }
    catch (XMLConfigurationException e) {
        fSecurityManager = null;
    }

}
 
Example 6
Source File: XMLScanner.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 *
 * @param componentManager The component manager.
 *
 * @throws SAXException Throws exception if required features and
 *                      properties cannot be found.
 */
public void reset(XMLComponentManager componentManager)
throws XMLConfigurationException {

            fParserSettings = componentManager.getFeature(PARSER_SETTINGS, true);

            if (!fParserSettings) {
                    // parser settings have not been changed
                    init();
                    return;
            }


    // Xerces properties
    fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    fEntityManager = (XMLEntityManager)componentManager.getProperty(ENTITY_MANAGER);
    fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER);

    //this step is extra because we have separated the storage of entity
    fEntityStore = fEntityManager.getEntityStore() ;

    // sax features
    fValidation = componentManager.getFeature(VALIDATION, false);
    fNamespaces = componentManager.getFeature(NAMESPACES, true);
    fNotifyCharRefs = componentManager.getFeature(NOTIFY_CHAR_REFS, false);

    init();
}
 
Example 7
Source File: JAXPValidatorComponent.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException {
    // obtain references from the manager
    fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    try {
        fEntityResolver = (XMLEntityResolver) componentManager.getProperty(ENTITY_MANAGER);
    }
    catch (XMLConfigurationException e) {
        fEntityResolver = null;
    }
}
 
Example 8
Source File: XMLVersionDetector.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 *
 * @param componentManager The component manager.
 *
 * @throws SAXException Throws exception if required features and
 *                      properties cannot be found.
 */
public void reset(XMLComponentManager componentManager)
    throws XMLConfigurationException {

    // Xerces properties
    fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    fEntityManager = (XMLEntityManager)componentManager.getProperty(ENTITY_MANAGER);
    for(int i=14; i<fExpectedVersionString.length; i++ )
        fExpectedVersionString[i] = ' ';
}
 
Example 9
Source File: DTDGrammarUtil.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void reset(XMLComponentManager componentManager)
throws XMLConfigurationException {

    fDTDGrammar = null;
    fInElementContent = false;
    fCurrentElementIndex = -1;
    fCurrentContentSpecType = -1;
    fNamespaces = componentManager.getFeature(NAMESPACES, true);
    fSymbolTable = (SymbolTable) componentManager.getProperty(
            Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);
    fElementDepth = -1;
}
 
Example 10
Source File: CMNodeFactory.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void reset(XMLComponentManager componentManager){
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    try {
        fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER);
        //we are setting the limit of number of nodes to 3times the maxOccur value..
        if(fSecurityManager != null){
            maxNodeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT) * MULTIPLICITY ;
        }
    }
    catch (XMLConfigurationException e) {
        fSecurityManager = null;
    }

}
 
Example 11
Source File: XML11DTDValidator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void reset(XMLComponentManager manager) {
    XMLDTDValidator curr = null;
    if((curr = (XMLDTDValidator)manager.getProperty(DTD_VALIDATOR_PROPERTY)) != null &&
            curr != this) {
        fGrammarBucket = curr.getGrammarBucket();
    }
    super.reset(manager);
}
 
Example 12
Source File: JAXPValidatorComponent.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException {
    // obtain references from the manager
    fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    try {
        fEntityResolver = (XMLEntityResolver) componentManager.getProperty(ENTITY_MANAGER);
    }
    catch (XMLConfigurationException e) {
        fEntityResolver = null;
    }
}
 
Example 13
Source File: XMLDTDProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
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 14
Source File: XMLDTDProcessor.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
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 15
Source File: XMLDocumentFragmentScannerImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Resets the component. The component can query the component manager
 * about any features and properties that affect the operation of the
 * component.
 *
 * @param componentManager The component manager.
 *
 * @throws SAXException Thrown by component on initialization error.
 *                      For example, if a feature or property is
 *                      required for the operation of the component, the
 *                      component manager may throw a
 *                      SAXNotRecognizedException or a
 *                      SAXNotSupportedException.
 */

public void reset(XMLComponentManager componentManager)
throws XMLConfigurationException {

    super.reset(componentManager);

    // other settings
    // fDocumentSystemId = null;

    // sax features
    //fAttributes.setNamespaces(fNamespaces);

    // xerces features
    fReportCdataEvent = componentManager.getFeature(Constants.STAX_REPORT_CDATA_EVENT, true);
    fSecurityManager = (XMLSecurityManager)componentManager.getProperty(Constants.SECURITY_MANAGER, null);
    fNotifyBuiltInRefs = componentManager.getFeature(NOTIFY_BUILTIN_REFS, false);

    Object resolver = componentManager.getProperty(ENTITY_RESOLVER, null);
    fExternalSubsetResolver = (resolver instanceof ExternalSubsetResolver) ?
            (ExternalSubsetResolver) resolver : null;

    //attribute
    fReadingAttributes = false;
    //xxx: external entities are supported in Xerces
    // it would be good to define feature for this case
    fSupportExternalEntities = true;
    fReplaceEntityReferences = true;
    fIsCoalesce = false;

    // setup Driver
    setScannerState(SCANNER_STATE_CONTENT);
    setDriver(fContentDriver);

    // JAXP 1.5 features and properties
    XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
            componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER, null);
    fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);

    fStrictURI = componentManager.getFeature(STANDARD_URI_CONFORMANT, false);

    resetCommon();
    //fEntityManager.test();
}
 
Example 16
Source File: XMLEntityScanner.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Resets the component. The component can query the component manager
 * about any features and properties that affect the operation of the
 * component.
 *
 * @param componentManager The component manager.
 *
 * @throws SAXException Thrown by component on initialization error.
 *                      For example, if a feature or property is
 *                      required for the operation of the component, the
 *                      component manager may throw a
 *                      SAXNotRecognizedException or a
 *                      SAXNotSupportedException.
 */
public void reset(XMLComponentManager componentManager)
throws XMLConfigurationException {
    // xerces features
    fAllowJavaEncodings = componentManager.getFeature(ALLOW_JAVA_ENCODINGS, false);

    //xerces properties
    fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
    resetCommon();
}
 
Example 17
Source File: XMLErrorReporter.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Resets the component. The component can query the component manager
 * about any features and properties that affect the operation of the
 * component.
 *
 * @param componentManager The component manager.
 *
 * @throws SAXException Thrown by component on initialization error.
 *                      For example, if a feature or property is
 *                      required for the operation of the component, the
 *                      component manager may throw a
 *                      SAXNotRecognizedException or a
 *                      SAXNotSupportedException.
 */
public void reset(XMLComponentManager componentManager)
    throws XNIException {

    // features
    fContinueAfterFatalError = componentManager.getFeature(CONTINUE_AFTER_FATAL_ERROR, false);

    // properties
    fErrorHandler = (XMLErrorHandler)componentManager.getProperty(ERROR_HANDLER);

}
 
Example 18
Source File: XMLEntityStorage.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Resets the component. The component can query the component manager
 * about any features and properties that affect the operation of the
 * component.
 *
 * @param componentManager The component manager.
 *
 * @throws SAXException Thrown by component on initialization error.
 *                      For example, if a feature or property is
 *                      required for the operation of the component, the
 *                      component manager may throw a
 *                      SAXNotRecognizedException or a
 *                      SAXNotSupportedException.
 */
public void reset(XMLComponentManager componentManager)
throws XMLConfigurationException {


    // xerces features

    fWarnDuplicateEntityDef = componentManager.getFeature(WARN_ON_DUPLICATE_ENTITYDEF, false);

    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);

    fEntities.clear();
    fCurrentEntity = null;

}
 
Example 19
Source File: XMLErrorReporter.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Resets the component. The component can query the component manager
 * about any features and properties that affect the operation of the
 * component.
 *
 * @param componentManager The component manager.
 *
 * @throws SAXException Thrown by component on initialization error.
 *                      For example, if a feature or property is
 *                      required for the operation of the component, the
 *                      component manager may throw a
 *                      SAXNotRecognizedException or a
 *                      SAXNotSupportedException.
 */
public void reset(XMLComponentManager componentManager)
    throws XNIException {

    // features
    fContinueAfterFatalError = componentManager.getFeature(CONTINUE_AFTER_FATAL_ERROR, false);

    // properties
    fErrorHandler = (XMLErrorHandler)componentManager.getProperty(ERROR_HANDLER);

}
 
Example 20
Source File: XMLNamespaceBinder.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Resets the component. The component can query the component manager
 * about any features and properties that affect the operation of the
 * component.
 *
 * @param componentManager The component manager.
 *
 * @throws SAXException Thrown by component on initialization error.
 *                      For example, if a feature or property is
 *                      required for the operation of the component, the
 *                      component manager may throw a
 *                      SAXNotRecognizedException or a
 *                      SAXNotSupportedException.
 */
public void reset(XMLComponentManager componentManager)
    throws XNIException {

    // features
    fNamespaces = componentManager.getFeature(NAMESPACES, true);

    // Xerces properties
    fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
    fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);

}