Java 类org.xml.sax.SAXNotRecognizedException 实例源码

项目:apache-tomcat-7.0.73-with-comment    文件:XercesParser.java   
/**
 * Configure schema validation as recommended by the JAXP 1.2 spec.
 * The <code>properties</code> object may contains information about
 * the schema local and language. 
 * @param properties parser optional info
 */
private static void configureOldXerces(SAXParser parser, 
                                       Properties properties) 
        throws ParserConfigurationException, 
               SAXNotSupportedException {

    String schemaLocation = (String)properties.get("schemaLocation");
    String schemaLanguage = (String)properties.get("schemaLanguage");

    try{
        if (schemaLocation != null) {
            parser.setProperty(JAXP_SCHEMA_LANGUAGE, schemaLanguage);
            parser.setProperty(JAXP_SCHEMA_SOURCE, schemaLocation);
        }
    } catch (SAXNotRecognizedException e){
        log.info(parser.getClass().getName() + ": " 
                                    + e.getMessage() + " not supported."); 
    }

}
项目:openjdk-jdk10    文件:SAXParserImpl.java   
private void setSchemaValidatorFeature(String name, boolean value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fSAXParser.fSchemaValidator.setFeature(name, value);
    }
    // This should never be thrown from the schema validator.
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "feature-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "feature-not-supported", new Object [] {identifier}));
        }
    }
}
项目:openjdk-jdk10    文件:XmlUtil.java   
public static SAXParserFactory newSAXParserFactory(boolean disableSecurity) {
    SAXParserFactory factory = SAXParserFactory.newInstance();
    String featureToSet = XMLConstants.FEATURE_SECURE_PROCESSING;
    try {
        boolean securityOn = !xmlSecurityDisabled(disableSecurity);
        factory.setFeature(featureToSet, securityOn);
        factory.setNamespaceAware(true);
        if (securityOn) {
            featureToSet = DISALLOW_DOCTYPE_DECL;
            factory.setFeature(featureToSet, true);
            featureToSet = EXTERNAL_GE;
            factory.setFeature(featureToSet, false);
            featureToSet = EXTERNAL_PE;
            factory.setFeature(featureToSet, false);
            featureToSet = LOAD_EXTERNAL_DTD;
            factory.setFeature(featureToSet, false);
        }
    } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
        LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support "+featureToSet+" feature!", new Object[]{factory.getClass().getName()});
    }
    return factory;
}
项目:lams    文件:XercesParser.java   
/**
 * Configure schema validation as recommended by the JAXP 1.2 spec.
 * The <code>properties</code> object may contains information about
 * the schema local and language. 
 * @param properties parser optional info
 */
private static void configureOldXerces(SAXParser parser, 
                                       Properties properties) 
        throws ParserConfigurationException, 
               SAXNotSupportedException {

    String schemaLocation = (String)properties.get("schemaLocation");
    String schemaLanguage = (String)properties.get("schemaLanguage");

    try{
        if (schemaLocation != null) {
            parser.setProperty(JAXP_SCHEMA_LANGUAGE, schemaLanguage);
            parser.setProperty(JAXP_SCHEMA_SOURCE, schemaLocation);
        }
    } catch (SAXNotRecognizedException e){
        log.info(parser.getClass().getName() + ": " 
                                    + e.getMessage() + " not supported."); 
    }

}
项目:lams    文件:GenericParser.java   
/**
 * Create a <code>SAXParser</code> configured to support XML Scheman and DTD
 * @param properties parser specific properties/features
 * @return an XML Schema/DTD enabled <code>SAXParser</code>
 */
public static SAXParser newSAXParser(Properties properties)
        throws ParserConfigurationException, 
               SAXException,
               SAXNotRecognizedException{ 

    SAXParserFactory factory = 
                    (SAXParserFactory)properties.get("SAXParserFactory");
    SAXParser parser = factory.newSAXParser();
    String schemaLocation = (String)properties.get("schemaLocation");
    String schemaLanguage = (String)properties.get("schemaLanguage");

    try{
        if (schemaLocation != null) {
            parser.setProperty(JAXP_SCHEMA_LANGUAGE, schemaLanguage);
            parser.setProperty(JAXP_SCHEMA_SOURCE, schemaLocation);
        }
    } catch (SAXNotRecognizedException e){
        log.info(parser.getClass().getName() + ": "  
                                    + e.getMessage() + " not supported."); 
    }
    return parser;
}
项目:openjdk-jdk10    文件:SAXDocumentParser.java   
public Object getProperty(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
        return getLexicalHandler();
    } else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
        return getDeclHandler();
    } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
        return getExternalVocabularies();
    } else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
        return getRegisteredEncodingAlgorithms();
    } else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
        return getEncodingAlgorithmContentHandler();
    } else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
        return getPrimitiveTypeContentHandler();
    } else {
        throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
                getString("message.propertyNotRecognized", new Object[]{name}));
    }
}
项目:lazycat    文件:Digester.java   
/**
 * Return the SAXParserFactory we will use, creating one if necessary.
 * 
 * @throws ParserConfigurationException
 * @throws SAXNotSupportedException
 * @throws SAXNotRecognizedException
 */
public SAXParserFactory getFactory()
        throws SAXNotRecognizedException, SAXNotSupportedException, ParserConfigurationException {

    if (factory == null) {
        factory = SAXParserFactory.newInstance();

        factory.setNamespaceAware(namespaceAware);
        // Preserve xmlns attributes
        if (namespaceAware) {
            factory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
        }

        factory.setValidating(validating);
        if (validating) {
            // Enable DTD validation
            factory.setFeature("http://xml.org/sax/features/validation", true);
            // Enable schema validation
            factory.setFeature("http://apache.org/xml/features/validation/schema", true);
        }
    }
    return (factory);

}
项目:OpenJSharp    文件:SAXBufferProcessor.java   
public void setFeature(String name, boolean value)
        throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(Features.NAMESPACES_FEATURE)) {
        if (!value) {
            throw new SAXNotSupportedException(name + ":" + value);
        }
    } else if (name.equals(Features.NAMESPACE_PREFIXES_FEATURE)) {
        _namespacePrefixesFeature = value;
    } else if (name.equals(Features.EXTERNAL_GENERAL_ENTITIES)) {
        // ignore
    } else if (name.equals(Features.EXTERNAL_PARAMETER_ENTITIES)) {
        // ignore
    } else if (name.equals(Features.STRING_INTERNING_FEATURE)) {
        if (value != _stringInterningFeature) {
            throw new SAXNotSupportedException(name + ":" + value);
        }
    } else {
        throw new SAXNotRecognizedException(
                "Feature not supported: " + name);
    }
}
项目:openjdk-jdk10    文件:ParserAdapter.java   
/**
 * Set a feature flag for the parser.
 *
 * <p>The only features recognized are namespaces and
 * namespace-prefixes.</p>
 *
 * @param name The feature name, as a complete URI.
 * @param value The requested feature value.
 * @exception SAXNotRecognizedException If the feature
 *            can't be assigned or retrieved.
 * @exception SAXNotSupportedException If the feature
 *            can't be assigned that value.
 * @see org.xml.sax.XMLReader#setFeature
 */
public void setFeature (String name, boolean value)
    throws SAXNotRecognizedException, SAXNotSupportedException
{
    if (name.equals(NAMESPACES)) {
        checkNotParsing("feature", name);
        namespaces = value;
        if (!namespaces && !prefixes) {
            prefixes = true;
        }
    } else if (name.equals(NAMESPACE_PREFIXES)) {
        checkNotParsing("feature", name);
        prefixes = value;
        if (!prefixes && !namespaces) {
            namespaces = true;
        }
    } else if (name.equals(XMLNS_URIs)) {
        checkNotParsing("feature", name);
        uris = value;
    } else {
        throw new SAXNotRecognizedException("Feature: " + name);
    }
}
项目:openjdk-jdk10    文件:ValidatorImpl.java   
@Override
public boolean getFeature(String name)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException();
    }
    try {
        return fComponentManager.getFeature(name);
    }
    catch (XMLConfigurationException e) {
        final String identifier = e.getIdentifier();
        final String key = e.getType() == Status.NOT_RECOGNIZED ?
                "feature-not-recognized" : "feature-not-supported";
        throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                key, new Object [] {identifier}));
    }
}
项目:OpenJSharp    文件:ParserAdapter.java   
/**
 * Set a feature flag for the parser.
 *
 * <p>The only features recognized are namespaces and
 * namespace-prefixes.</p>
 *
 * @param name The feature name, as a complete URI.
 * @param value The requested feature value.
 * @exception SAXNotRecognizedException If the feature
 *            can't be assigned or retrieved.
 * @exception SAXNotSupportedException If the feature
 *            can't be assigned that value.
 * @see org.xml.sax.XMLReader#setFeature
 */
public void setFeature (String name, boolean value)
    throws SAXNotRecognizedException, SAXNotSupportedException
{
    if (name.equals(NAMESPACES)) {
        checkNotParsing("feature", name);
        namespaces = value;
        if (!namespaces && !prefixes) {
            prefixes = true;
        }
    } else if (name.equals(NAMESPACE_PREFIXES)) {
        checkNotParsing("feature", name);
        prefixes = value;
        if (!prefixes && !namespaces) {
            namespaces = true;
        }
    } else if (name.equals(XMLNS_URIs)) {
        checkNotParsing("feature", name);
        uris = value;
    } else {
        throw new SAXNotRecognizedException("Feature: " + name);
    }
}
项目:alfresco-xml-factory    文件:FactoryHelper.java   
private void setFeature(SAXParserFactory factory, String feature, boolean enable)
{
    try
    {
        if (ADDITIONAL_FEATURE_X_INCLUDE_AWARE.equals(feature))
        {
            factory.setXIncludeAware(enable);
        }
        else if (!ADDITIONAL_FEATURE_EXPAND_ENTITY_REFERENCES.equals(feature)) // Does not exist on SAXParserFactory
        {
            factory.setFeature(feature, enable);
        }
        debug(debugCounter+" SAXParserFactory "+feature+" "+enable);
    }
    catch (ParserConfigurationException | SAXNotSupportedException | SAXNotRecognizedException e)
    {
        logConfigurationFailure(factory.getClass().getName(), feature, e);
    }
}
项目:openjdk-jdk10    文件:CLDRConverter.java   
/**
 * Configure the parser to allow access to DTDs on the file system.
 */
private static void enableFileAccess(SAXParser parser) throws SAXNotSupportedException {
    try {
        parser.setProperty("http://javax.xml.XMLConstants/property/accessExternalDTD", "file");
    } catch (SAXNotRecognizedException ignore) {
        // property requires >= JAXP 1.5
    }
}
项目:OpenJSharp    文件:ValidatorImpl.java   
public Object getProperty(String name)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException();
    }
    //Support current-element-node; return current node if DOMSource is used.
    if (CURRENT_ELEMENT_NODE.equals(name)) {
        return (fDOMValidatorHelper != null) ? fDOMValidatorHelper.getCurrentElement() : null;
    }
    try {
        return fComponentManager.getProperty(name);
    }
    catch (XMLConfigurationException e) {
        final String identifier = e.getIdentifier();
        final String key = e.getType() == Status.NOT_RECOGNIZED ?
                "property-not-recognized" : "property-not-supported";
        throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                key, new Object [] {identifier}));
    }
}
项目:OpenJSharp    文件:ValidatorHandlerImpl.java   
public void setProperty(String name, Object object)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException();
    }
    try {
        fComponentManager.setProperty(name, object);
    }
    catch (XMLConfigurationException e) {
        final String identifier = e.getIdentifier();
        final String key = e.getType() == Status.NOT_RECOGNIZED ?
                "property-not-recognized" : "property-not-supported";
        throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                key, new Object [] {identifier}));
    }
}
项目:OpenJSharp    文件:SAXParserImpl.java   
private void setSchemaValidatorFeature(String name, boolean value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fSAXParser.fSchemaValidator.setFeature(name, value);
    }
    // This should never be thrown from the schema validator.
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "feature-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "feature-not-supported", new Object [] {identifier}));
        }
    }
}
项目:Reer    文件:DefaultDeploymentDescriptor.java   
private static XmlParser createParser() {
    try {
        XmlParser parser = new XmlParser(false, true, true);
        try {
            // If not set for >= JAXP 1.5 / Java8 won't allow referencing DTDs, e.g.
            // using http URLs, because Groovy's XmlParser requests FEATURE_SECURE_PROCESSING
            parser.setProperty(ACCESS_EXTERNAL_DTD, ALLOW_ANY_EXTERNAL_DTD);
        } catch (SAXNotRecognizedException ignore) {
            // property requires >= JAXP 1.5 / Java8
        }
        return parser;
    } catch (Exception ex) {
        throw new UncheckedException(ex);
    }
}
项目:openjdk-jdk10    文件:Bug4969110.java   
@Test
public void test1() throws SAXException {
    try {
        ValidatorHandler validatorHandler = schemaFactory.newSchema().newValidatorHandler();
        validatorHandler.getProperty("unknown1234");
        Assert.fail("SAXNotRecognizedException was not thrown.");
    } catch (SAXNotRecognizedException e) {
    }
}
项目:tomcat7    文件:XercesParser.java   
/**
 * Configure schema validation as recommended by the Xerces spec. 
 * Both DTD and Schema validation will be enabled simultaneously.
 * @param factory SAXParserFactory to be configured
 */
private static void configureXerces(SAXParserFactory factory)
        throws ParserConfigurationException, 
               SAXNotRecognizedException, 
               SAXNotSupportedException {

    factory.setFeature(XERCES_DYNAMIC, true);
    factory.setFeature(XERCES_SCHEMA, true);

}
项目:openjdk-jdk10    文件:TransformerTest.java   
public void setFeature(final String name, final boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name.equals(NAMESPACES)) {
        namespaces = value;
    } else if (name.equals(NAMESPACE_PREFIXES)) {
        namespacePrefixes = value;
    } else {
        throw new SAXNotRecognizedException();
    }
}
项目:tomcat7    文件:ParserFeatureSetterFactory.java   
/**
 * Create a new <code>SAXParser</code>
 * @param properties (logical) properties to be set on parser
 * @return a <code>SAXParser</code> configured based on the underlying
 * parser implementation.
 */
public static SAXParser newSAXParser(Properties properties)
        throws ParserConfigurationException, 
               SAXException,
               SAXNotRecognizedException, 
               SAXNotSupportedException {

    if (isXercesUsed){
        return XercesParser.newSAXParser(properties);
    } else {
        return GenericParser.newSAXParser(properties);
    }
}
项目:openjdk-jdk10    文件:XMLReaderTest.java   
/**
 * getFeature with a unknown feature name throws SAXNotRecognizedException.
 *
 * @throws Exception If any errors occur.
 */
@Test(expectedExceptions = SAXNotRecognizedException.class)
public void featureNE01() throws Exception {
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(true);
    spf.newSAXParser().getXMLReader().getFeature("no-meaning-feature");
}
项目:openjdk-jdk10    文件:DocumentBuilderImpl.java   
private void setFeatures( Map<String, Boolean> features)
    throws SAXNotSupportedException, SAXNotRecognizedException {
    if (features != null) {
        for (Map.Entry<String, Boolean> entry : features.entrySet()) {
            domParser.setFeature(entry.getKey(), entry.getValue());
    }
}
}
项目:openjdk-jdk10    文件:Bug6359330.java   
public static void main(String[] args) throws Throwable {
    System.setSecurityManager(new SecurityManager());
    try {
        SAXParserFactory spf = SAXParserFactory.newInstance();
        spf.setNamespaceAware(true);
        spf.setValidating(true);
        SAXParser sp = spf.newSAXParser();
        // The following line shouldn't throw a
        // java.security.AccessControlException.
        sp.setProperty("foo", "bar");
    } catch (SAXNotRecognizedException e) {
        // Ignore this expected exception.
    }
}
项目:lams    文件:ParserFeatureSetterFactory.java   
/**
 * Create a new <code>SAXParser</code>
 * @param properties (logical) properties to be set on parser
 * @return a <code>SAXParser</code> configured based on the underlying
 * parser implementation.
 */
public static SAXParser newSAXParser(Properties properties)
        throws ParserConfigurationException, 
               SAXException,
               SAXNotRecognizedException, 
               SAXNotSupportedException {

    if (isXercesUsed){
        return XercesParser.newSAXParser(properties);
    } else {
        return GenericParser.newSAXParser(properties);
    }
}
项目:openjdk-jdk10    文件:ContentHandlerNamespacePrefixAdapter.java   
@Override
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    if(name.equals(PREFIX_FEATURE)) {
        this.namespacePrefixes = value;
        return;
    }
    if(name.equals(NAMESPACE_FEATURE) && value)
        return;
    super.setFeature(name, value);
}
项目:openjdk-jdk10    文件:DOMParser.java   
/**
 * Query the state of a feature.
 *
 * Query the current state of any feature in a SAX2 parser.  The
 * parser might not recognize the feature.
 *
 * @param featureId The unique identifier (URI) of the feature
 *                  being set.
 * @return The current state of the feature.
 * @exception org.xml.sax.SAXNotRecognizedException If the
 *            requested feature is not known.
 * @exception SAXNotSupportedException If the
 *            requested feature is known but not supported.
 */
public boolean getFeature(String featureId)
    throws SAXNotRecognizedException, SAXNotSupportedException {

    try {

        // http://xml.org/sax/features/use-entity-resolver2
        //   controls whether the methods of an object implementing
        //   org.xml.sax.ext.EntityResolver2 will be used by the parser.
        //
        if (featureId.equals(USE_ENTITY_RESOLVER2)) {
            return fUseEntityResolver2;
        }

        //
        // Default handling
        //

        return fConfiguration.getFeature(featureId);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "feature-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "feature-not-supported", new Object [] {identifier}));
        }
    }

}
项目:OpenJSharp    文件:ContentHandlerNamespacePrefixAdapter.java   
@Override
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    if(name.equals(PREFIX_FEATURE)) {
        this.namespacePrefixes = value;
        return;
    }
    if(name.equals(NAMESPACE_FEATURE) && value)
        return;
    super.setFeature(name, value);
}
项目:openjdk-jdk10    文件:SchemaFactoryTest.java   
@Test(expectedExceptions = NullPointerException.class)
public void testGetNullFeature() throws SAXNotRecognizedException, SAXNotSupportedException {
    SchemaFactory sf = newSchemaFactory();
    assertNotNull(sf);
    sf.getFeature(null);

}
项目:OpenJSharp    文件:JAXBSource.java   
public void setProperty(String name, Object value) throws SAXNotRecognizedException {
    if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) {
        this.lexicalHandler = (LexicalHandler)value;
        return;
    }
    throw new SAXNotRecognizedException(name);
}
项目:HtmlCompat    文件:Parser.java   
public boolean getFeature (String name)
        throws SAXNotRecognizedException, SAXNotSupportedException {
    Boolean b = (Boolean)theFeatures.get(name);
    if (b == null) {
        throw new SAXNotRecognizedException("Unknown feature " + name);
    }
    return b.booleanValue();
}
项目:openjdk-jdk10    文件:ValidatorHandlerTest.java   
@Test(expectedExceptions = NullPointerException.class)
public void testGetNullFeature() throws SAXNotRecognizedException, SAXNotSupportedException {
    ValidatorHandler validatorHandler = getValidatorHandler();
    assertNotNull(validatorHandler);
    validatorHandler.getFeature(null);

}
项目:OpenJSharp    文件:DocumentBuilderImpl.java   
private void setFeatures(Hashtable features)
    throws SAXNotSupportedException, SAXNotRecognizedException {
    if (features != null) {
        Iterator entries = features.entrySet().iterator();
        while (entries.hasNext()) {
            Map.Entry entry = (Map.Entry) entries.next();
            String feature = (String) entry.getKey();
            boolean value = ((Boolean) entry.getValue()).booleanValue();
            domParser.setFeature(feature, value);
    }
}
}
项目:apache-tomcat-7.0.73-with-comment    文件:XercesParser.java   
/**
 * Configure schema validation as recommended by the Xerces spec. 
 * Both DTD and Schema validation will be enabled simultaneously.
 * @param factory SAXParserFactory to be configured
 */
private static void configureXerces(SAXParserFactory factory)
        throws ParserConfigurationException, 
               SAXNotRecognizedException, 
               SAXNotSupportedException {

    factory.setFeature(XERCES_DYNAMIC, true);
    factory.setFeature(XERCES_SCHEMA, true);

}
项目:openjdk-jdk10    文件:JdkXmlUtils.java   
/**
 * Sets the XMLReader instance with the specified property if the the
 * property is supported, ignores error if not, issues a warning if so
 * requested.
 *
 * @param reader an XMLReader instance
 * @param property the name of the property
 * @param value the value of the property
 * @param warn a flag indicating whether a warning should be issued
 */
public static void setXMLReaderPropertyIfSupport(XMLReader reader, String property,
        Object value, boolean warn) {
    try {
        reader.setProperty(property, value);
    } catch (SAXNotRecognizedException | SAXNotSupportedException e) {
        if (warn) {
            XMLSecurityManager.printWarning(reader.getClass().getName(),
                    property, e);
        }
    }
}
项目:openjdk-jdk10    文件:SAXParserImpl.java   
/**
 * Set any features of our XMLReader based on any features set on the
 * SAXParserFactory.
 *
 * XXX Does not handle possible conflicts between SAX feature names and
 * JAXP specific feature names, eg. SAXParserFactory.isValidating()
 */
private void setFeatures(Map<String, Boolean> features)
    throws SAXNotSupportedException, SAXNotRecognizedException {
    if (features != null) {
        for (Map.Entry<String, Boolean> entry : features.entrySet()) {
            xmlReader.setFeature0(entry.getKey(), entry.getValue());
        }
    }
}
项目:openjdk-jdk10    文件:ValidatorHandlerTest.java   
@Test(expectedExceptions = NullPointerException.class)
public void testGetNullProperty() throws SAXNotRecognizedException, SAXNotSupportedException {
    ValidatorHandler validatorHandler = getValidatorHandler();
    assertNotNull(validatorHandler);
    validatorHandler.getProperty(null);

}
项目:openjdk-jdk10    文件:SAXParserFactoryImpl.java   
@Override
public void setFeature(String name, boolean value) throws ParserConfigurationException,
        SAXNotRecognizedException, SAXNotSupportedException {

}
项目:openjdk-jdk10    文件:DOM2TO.java   
/**
 * This class is only used internally so this method should never
 * be called.
 */
public void setFeature(String name, boolean value) throws
    SAXNotRecognizedException, SAXNotSupportedException
{
}
项目:openjdk-jdk10    文件:ValidatorHandlerTest.java   
@Test(expectedExceptions = SAXNotRecognizedException.class)
public void testGetUnrecognizedProperty() throws SAXNotRecognizedException, SAXNotSupportedException {
    ValidatorHandler validatorHandler = getValidatorHandler();
    validatorHandler.getProperty(FEATURE_NAME);

}