com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration. 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: AbstractDOMParser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/** Default constructor. */
protected AbstractDOMParser (XMLParserConfiguration config) {

    super (config);


    // add recognized features
    fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES);

    // set default values
    fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true);
    fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true);
    fConfiguration.setFeature (DEFER_NODE_EXPANSION, true);
    fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true);
    fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true);

    // add recognized properties
    fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES);

    // set default values
    fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
    DEFAULT_DOCUMENT_CLASS_NAME);

}
 
Example #2
Source File: XIncludeHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void copyFeatures1(
    Enumeration features,
    String featurePrefix,
    XMLComponentManager from,
    XMLParserConfiguration to) {
    while (features.hasMoreElements()) {
        String featureId = featurePrefix + (String)features.nextElement();
        boolean value = from.getFeature(featureId);

        try {
            to.setFeature(featureId, value);
        }
        catch (XMLConfigurationException e) {
            // componentManager doesn't support this feature,
            // so we won't worry about it
        }
    }
}
 
Example #3
Source File: AbstractDOMParser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/** Default constructor. */
protected AbstractDOMParser (XMLParserConfiguration config) {

    super (config);


    // add recognized features
    fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES);

    // set default values
    fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true);
    fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true);
    fConfiguration.setFeature (DEFER_NODE_EXPANSION, true);
    fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true);
    fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true);

    // add recognized properties
    fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES);

    // set default values
    fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
    DEFAULT_DOCUMENT_CLASS_NAME);

}
 
Example #4
Source File: AbstractDOMParser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Default constructor. */
protected AbstractDOMParser (XMLParserConfiguration config) {

    super (config);


    // add recognized features
    fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES);

    // set default values
    fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true);
    fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true);
    fConfiguration.setFeature (DEFER_NODE_EXPANSION, true);
    fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true);
    fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true);

    // add recognized properties
    fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES);

    // set default values
    fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
    DEFAULT_DOCUMENT_CLASS_NAME);

}
 
Example #5
Source File: XIncludeHandler.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
private void copyFeatures1(
    Enumeration<Object> features,
    String featurePrefix,
    XMLComponentManager from,
    XMLParserConfiguration to) {
    while (features.hasMoreElements()) {
        String featureId = featurePrefix + (String)features.nextElement();
        boolean value = from.getFeature(featureId);

        try {
            to.setFeature(featureId, value);
        }
        catch (XMLConfigurationException e) {
            // componentManager doesn't support this feature,
            // so we won't worry about it
        }
    }
}
 
Example #6
Source File: AbstractDOMParser.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** Default constructor. */
protected AbstractDOMParser (XMLParserConfiguration config) {

    super (config);


    // add recognized features
    fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES);

    // set default values
    fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true);
    fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true);
    fConfiguration.setFeature (DEFER_NODE_EXPANSION, true);
    fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true);
    fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true);

    // add recognized properties
    fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES);

    // set default values
    fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
    DEFAULT_DOCUMENT_CLASS_NAME);

}
 
Example #7
Source File: DOMParserImpl.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a DOM Builder using the standard parser configuration.
 */
public DOMParserImpl (XMLParserConfiguration config, String schemaType) {
    this (config);
    if (schemaType != null) {
        if (schemaType.equals (Constants.NS_DTD)) {
            //Schema validation is false by default and hence there is no
            //need to set it to false here.  Also, schema validation is
            //not a recognized feature for DTDConfiguration's and so
            //setting this feature here would result in a Configuration
            //Exception.
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_DTD);
            fSchemaType = Constants.NS_DTD;
        }
        else if (schemaType.equals (Constants.NS_XMLSCHEMA)) {
            // XML Schem validation
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_XMLSCHEMA);
        }
    }

}
 
Example #8
Source File: AbstractDOMParser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/** Default constructor. */
protected AbstractDOMParser (XMLParserConfiguration config) {

    super (config);


    // add recognized features
    fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES);

    // set default values
    fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true);
    fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true);
    fConfiguration.setFeature (DEFER_NODE_EXPANSION, true);
    fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true);
    fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true);

    // add recognized properties
    fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES);

    // set default values
    fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
    DEFAULT_DOCUMENT_CLASS_NAME);

}
 
Example #9
Source File: DOMParserImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a DOM Builder using the standard parser configuration.
 */
public DOMParserImpl (XMLParserConfiguration config, String schemaType) {
    this (config);
    if (schemaType != null) {
        if (schemaType.equals (Constants.NS_DTD)) {
            //Schema validation is false by default and hence there is no
            //need to set it to false here.  Also, schema validation is
            //not a recognized feature for DTDConfiguration's and so
            //setting this feature here would result in a Configuration
            //Exception.
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_DTD);
            fSchemaType = Constants.NS_DTD;
        }
        else if (schemaType.equals (Constants.NS_XMLSCHEMA)) {
            // XML Schem validation
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_XMLSCHEMA);
        }
    }

}
 
Example #10
Source File: AbstractDOMParser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/** Default constructor. */
protected AbstractDOMParser (XMLParserConfiguration config) {

    super (config);


    // add recognized features
    fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES);

    // set default values
    fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true);
    fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true);
    fConfiguration.setFeature (DEFER_NODE_EXPANSION, true);
    fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true);
    fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true);

    // add recognized properties
    fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES);

    // set default values
    fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
    DEFAULT_DOCUMENT_CLASS_NAME);

}
 
Example #11
Source File: DOMParserImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a DOM Builder using the standard parser configuration.
 */
public DOMParserImpl (XMLParserConfiguration config, String schemaType) {
    this (config);
    if (schemaType != null) {
        if (schemaType.equals (Constants.NS_DTD)) {
            //Schema validation is false by default and hence there is no
            //need to set it to false here.  Also, schema validation is
            //not a recognized feature for DTDConfiguration's and so
            //setting this feature here would result in a Configuration
            //Exception.
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_DTD);
            fSchemaType = Constants.NS_DTD;
        }
        else if (schemaType.equals (Constants.NS_XMLSCHEMA)) {
            // XML Schem validation
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_XMLSCHEMA);
        }
    }

}
 
Example #12
Source File: DOMParserImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a DOM Builder using the standard parser configuration.
 */
public DOMParserImpl (XMLParserConfiguration config, String schemaType) {
    this (config);
    if (schemaType != null) {
        if (schemaType.equals (Constants.NS_DTD)) {
            //Schema validation is false by default and hence there is no
            //need to set it to false here.  Also, schema validation is
            //not a recognized feature for DTDConfiguration's and so
            //setting this feature here would result in a Configuration
            //Exception.
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_DTD);
            fSchemaType = Constants.NS_DTD;
        }
        else if (schemaType.equals (Constants.NS_XMLSCHEMA)) {
            // XML Schem validation
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_XMLSCHEMA);
        }
    }

}
 
Example #13
Source File: XIncludeHandler.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void copyFeatures1(
    Enumeration features,
    String featurePrefix,
    XMLComponentManager from,
    XMLParserConfiguration to) {
    while (features.hasMoreElements()) {
        String featureId = featurePrefix + (String)features.nextElement();
        boolean value = from.getFeature(featureId);

        try {
            to.setFeature(featureId, value);
        }
        catch (XMLConfigurationException e) {
            // componentManager doesn't support this feature,
            // so we won't worry about it
        }
    }
}
 
Example #14
Source File: XIncludeHandler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void copyFeatures1(
    Enumeration features,
    String featurePrefix,
    XMLComponentManager from,
    XMLParserConfiguration to) {
    while (features.hasMoreElements()) {
        String featureId = featurePrefix + (String)features.nextElement();
        boolean value = from.getFeature(featureId);

        try {
            to.setFeature(featureId, value);
        }
        catch (XMLConfigurationException e) {
            // componentManager doesn't support this feature,
            // so we won't worry about it
        }
    }
}
 
Example #15
Source File: DOMParserImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a DOM Builder using the standard parser configuration.
 */
public DOMParserImpl (XMLParserConfiguration config, String schemaType) {
    this (config);
    if (schemaType != null) {
        if (schemaType.equals (Constants.NS_DTD)) {
            //Schema validation is false by default and hence there is no
            //need to set it to false here.  Also, schema validation is
            //not a recognized feature for DTDConfiguration's and so
            //setting this feature here would result in a Configuration
            //Exception.
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_DTD);
            fSchemaType = Constants.NS_DTD;
        }
        else if (schemaType.equals (Constants.NS_XMLSCHEMA)) {
            // XML Schem validation
            fConfiguration.setProperty (
            Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE,
            Constants.NS_XMLSCHEMA);
        }
    }

}
 
Example #16
Source File: AbstractDOMParser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** Default constructor. */
protected AbstractDOMParser (XMLParserConfiguration config) {

    super (config);


    // add recognized features
    fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES);

    // set default values
    fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true);
    fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true);
    fConfiguration.setFeature (DEFER_NODE_EXPANSION, true);
    fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true);
    fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true);

    // add recognized properties
    fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES);

    // set default values
    fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
    DEFAULT_DOCUMENT_CLASS_NAME);

}
 
Example #17
Source File: AbstractDOMParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Default constructor. */
protected AbstractDOMParser (XMLParserConfiguration config) {

    super (config);


    // add recognized features
    fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES);

    // set default values
    fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true);
    fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true);
    fConfiguration.setFeature (DEFER_NODE_EXPANSION, true);
    fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true);
    fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true);

    // add recognized properties
    fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES);

    // set default values
    fConfiguration.setProperty (DOCUMENT_CLASS_NAME,
    DEFAULT_DOCUMENT_CLASS_NAME);

}
 
Example #18
Source File: AbstractSAXParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
protected AbstractSAXParser(XMLParserConfiguration config) {
    super(config);

    config.addRecognizedFeatures(RECOGNIZED_FEATURES);
    config.addRecognizedProperties(RECOGNIZED_PROPERTIES);

    try {
        config.setFeature(ALLOW_UE_AND_NOTATION_EVENTS, false);
    }
    catch (XMLConfigurationException e) {
        // it wasn't a recognized feature, so we don't worry about it
    }
}
 
Example #19
Source File: StreamValidatorHelper.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private XMLParserConfiguration initialize() {
    XML11Configuration config = new XML11Configuration();
    if (fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        config.setProperty(SECURITY_MANAGER, new XMLSecurityManager());
    }
    config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER));
    config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER));
    XMLErrorReporter errorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER);
    config.setProperty(ERROR_REPORTER, errorReporter);
    // add message formatters
    if (errorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
        XMLMessageFormatter xmft = new XMLMessageFormatter();
        errorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
        errorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
    }
    config.setProperty(SYMBOL_TABLE, fComponentManager.getProperty(SYMBOL_TABLE));
    config.setProperty(VALIDATION_MANAGER, fComponentManager.getProperty(VALIDATION_MANAGER));
    config.setDocumentHandler(fSchemaValidator);
    config.setDTDHandler(null);
    config.setDTDContentModelHandler(null);
    config.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER,
            fComponentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER));
    config.setProperty(Constants.SECURITY_MANAGER,
            fComponentManager.getProperty(Constants.SECURITY_MANAGER));
    fConfiguration = new SoftReference(config);
    return config;
}
 
Example #20
Source File: StreamValidatorHelper.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private XMLParserConfiguration initialize() {
    XML11Configuration config = new XML11Configuration();
    if (fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        config.setProperty(SECURITY_MANAGER, new XMLSecurityManager());
    }
    config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER));
    config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER));
    XMLErrorReporter errorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER);
    config.setProperty(ERROR_REPORTER, errorReporter);
    // add message formatters
    if (errorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
        XMLMessageFormatter xmft = new XMLMessageFormatter();
        errorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
        errorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
    }
    config.setProperty(SYMBOL_TABLE, fComponentManager.getProperty(SYMBOL_TABLE));
    config.setProperty(VALIDATION_MANAGER, fComponentManager.getProperty(VALIDATION_MANAGER));
    config.setDocumentHandler(fSchemaValidator);
    config.setDTDHandler(null);
    config.setDTDContentModelHandler(null);
    config.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER,
            fComponentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER));
    config.setProperty(Constants.SECURITY_MANAGER,
            fComponentManager.getProperty(Constants.SECURITY_MANAGER));
    fConfiguration = new SoftReference(config);
    return config;
}
 
Example #21
Source File: AbstractXMLDocumentParser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs a document parser using the default symbol table
 * and grammar pool.
 */
protected AbstractXMLDocumentParser(XMLParserConfiguration config) {
    super(config);

    // set handlers
    config.setDocumentHandler(this);
    config.setDTDHandler(this);
    config.setDTDContentModelHandler(this);

}
 
Example #22
Source File: StreamValidatorHelper.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private XMLParserConfiguration initialize() {
    XML11Configuration config = new XML11Configuration();
    if (fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        config.setProperty(SECURITY_MANAGER, new XMLSecurityManager());
    }
    config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER));
    config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER));
    XMLErrorReporter errorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER);
    config.setProperty(ERROR_REPORTER, errorReporter);
    // add message formatters
    if (errorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
        XMLMessageFormatter xmft = new XMLMessageFormatter();
        errorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
        errorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
    }
    config.setProperty(SYMBOL_TABLE, fComponentManager.getProperty(SYMBOL_TABLE));
    config.setProperty(VALIDATION_MANAGER, fComponentManager.getProperty(VALIDATION_MANAGER));
    config.setDocumentHandler(fSchemaValidator);
    config.setDTDHandler(null);
    config.setDTDContentModelHandler(null);
    config.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER,
            fComponentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER));
    config.setProperty(Constants.SECURITY_MANAGER,
            fComponentManager.getProperty(Constants.SECURITY_MANAGER));
    fConfiguration = new SoftReference(config);
    return config;
}
 
Example #23
Source File: StreamValidatorHelper.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private XMLParserConfiguration initialize() {
    XML11Configuration config = new XML11Configuration();
    if (fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        config.setProperty(SECURITY_MANAGER, new XMLSecurityManager());
    }
    config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER));
    config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER));
    XMLErrorReporter errorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER);
    config.setProperty(ERROR_REPORTER, errorReporter);
    // add message formatters
    if (errorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
        XMLMessageFormatter xmft = new XMLMessageFormatter();
        errorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
        errorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
    }
    config.setProperty(SYMBOL_TABLE, fComponentManager.getProperty(SYMBOL_TABLE));
    config.setProperty(VALIDATION_MANAGER, fComponentManager.getProperty(VALIDATION_MANAGER));
    config.setDocumentHandler(fSchemaValidator);
    config.setDTDHandler(null);
    config.setDTDContentModelHandler(null);
    config.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER,
            fComponentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER));
    config.setProperty(Constants.SECURITY_MANAGER,
            fComponentManager.getProperty(Constants.SECURITY_MANAGER));
    fConfiguration = new SoftReference(config);
    return config;
}
 
Example #24
Source File: SchemaDOMParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
public SchemaDOMParser(XMLParserConfiguration config) {
    this.config = config;
    config.setDocumentHandler(this);
    config.setDTDHandler(this);
    config.setDTDContentModelHandler(this);
}
 
Example #25
Source File: AbstractSAXParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
protected AbstractSAXParser(XMLParserConfiguration config) {
    super(config);

    config.addRecognizedFeatures(RECOGNIZED_FEATURES);
    config.addRecognizedProperties(RECOGNIZED_PROPERTIES);

    try {
        config.setFeature(ALLOW_UE_AND_NOTATION_EVENTS, false);
    }
    catch (XMLConfigurationException e) {
        // it wasn't a recognized feature, so we don't worry about it
    }
}
 
Example #26
Source File: AbstractXMLDocumentParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs a document parser using the default symbol table
 * and grammar pool.
 */
protected AbstractXMLDocumentParser(XMLParserConfiguration config) {
    super(config);

    // set handlers
    config.setDocumentHandler(this);
    config.setDTDHandler(this);
    config.setDTDContentModelHandler(this);

}
 
Example #27
Source File: AbstractXMLDocumentParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs a document parser using the default symbol table
 * and grammar pool.
 */
protected AbstractXMLDocumentParser(XMLParserConfiguration config) {
    super(config);

    // set handlers
    config.setDocumentHandler(this);
    config.setDTDHandler(this);
    config.setDTDContentModelHandler(this);

}
 
Example #28
Source File: AbstractSAXParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
protected AbstractSAXParser(XMLParserConfiguration config) {
    super(config);

    config.addRecognizedFeatures(RECOGNIZED_FEATURES);
    config.addRecognizedProperties(RECOGNIZED_PROPERTIES);

    try {
        config.setFeature(ALLOW_UE_AND_NOTATION_EVENTS, false);
    }
    catch (XMLConfigurationException e) {
        // it wasn't a recognized feature, so we don't worry about it
    }
}
 
Example #29
Source File: AbstractSAXParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
protected AbstractSAXParser(XMLParserConfiguration config) {
    super(config);

    config.addRecognizedFeatures(RECOGNIZED_FEATURES);
    config.addRecognizedProperties(RECOGNIZED_PROPERTIES);

    try {
        config.setFeature(ALLOW_UE_AND_NOTATION_EVENTS, false);
    }
    catch (XMLConfigurationException e) {
        // it wasn't a recognized feature, so we don't worry about it
    }
}
 
Example #30
Source File: XIncludeHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void copyFeatures(
    XMLComponentManager from,
    XMLParserConfiguration to) {
    Enumeration features = Constants.getXercesFeatures();
    copyFeatures1(features, Constants.XERCES_FEATURE_PREFIX, from, to);
    features = Constants.getSAXFeatures();
    copyFeatures1(features, Constants.SAX_FEATURE_PREFIX, from, to);
}