com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper. 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: XMLSchemaFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private XMLSchemaFactory(boolean useServicesMechanism) {
    fUseServicesMechanism = useServicesMechanism;
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);
}
 
Example #2
Source File: XMLSchemaFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public XMLSchemaFactory() {
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);
    fXmlFeatures = new JdkXmlFeatures(fSecurityManager.isSecureProcessing());
    fOverrideDefaultParser = fXmlFeatures.getFeature(
                    JdkXmlFeatures.XmlFeature.JDK_OVERRIDE_PARSER);
    fXMLSchemaLoader.setFeature(JdkXmlUtils.OVERRIDE_PARSER, fOverrideDefaultParser);
}
 
Example #3
Source File: XMLSchemaFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public XMLSchemaFactory() {
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);
    fXmlFeatures = new JdkXmlFeatures(fSecurityManager.isSecureProcessing());
    fOverrideDefaultParser = fXmlFeatures.getFeature(
                    JdkXmlFeatures.XmlFeature.JDK_OVERRIDE_PARSER);
    fXMLSchemaLoader.setFeature(JdkXmlUtils.OVERRIDE_PARSER, fOverrideDefaultParser);
}
 
Example #4
Source File: XMLSchemaFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public XMLSchemaFactory() {
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);
    fXmlFeatures = new JdkXmlFeatures(fSecurityManager.isSecureProcessing());
    fOverrideDefaultParser = fXmlFeatures.getFeature(
                    JdkXmlFeatures.XmlFeature.JDK_OVERRIDE_PARSER);
    fXMLSchemaLoader.setFeature(JdkXmlUtils.OVERRIDE_PARSER, fOverrideDefaultParser);
}
 
Example #5
Source File: XMLSchemaFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private XMLSchemaFactory(boolean useServicesMechanism) {
    fUseServicesMechanism = useServicesMechanism;
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);
}
 
Example #6
Source File: XMLSchemaFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private XMLSchemaFactory(boolean useServicesMechanism) {
    fUseServicesMechanism = useServicesMechanism;
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);
}
 
Example #7
Source File: XMLSchemaFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private XMLSchemaFactory(boolean useServicesMechanism) {
    fUseServicesMechanism = useServicesMechanism;
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);
}
 
Example #8
Source File: XMLSchemaFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public XMLSchemaFactory() {
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);
    fXmlFeatures = new JdkXmlFeatures(fSecurityManager.isSecureProcessing());
    fOverrideDefaultParser = fXmlFeatures.getFeature(
                    JdkXmlFeatures.XmlFeature.JDK_OVERRIDE_PARSER);
    fXMLSchemaLoader.setFeature(JdkXmlUtils.OVERRIDE_PARSER, fOverrideDefaultParser);
}
 
Example #9
Source File: XMLSchemaFactory.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private XMLSchemaFactory(boolean useServicesMechanism) {
    fUseServicesMechanism = useServicesMechanism;
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);
}
 
Example #10
Source File: XMLSchemaFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private XMLSchemaFactory(boolean useServicesMechanism) {
    fUseServicesMechanism = useServicesMechanism;
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);
    fUseGrammarPoolOnly = true;

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);

    // use catalog
    fXMLSchemaLoader.setFeature(XMLConstants.USE_CATALOG, JdkXmlUtils.USE_CATALOG_DEFAULT);
    for (Feature f : Feature.values()) {
        fXMLSchemaLoader.setProperty(f.getPropertyName(), null);
    }

    fXMLSchemaLoader.setProperty(JdkXmlUtils.CDATA_CHUNK_SIZE, JdkXmlUtils.CDATA_CHUNK_SIZE_DEFAULT);
}
 
Example #11
Source File: XMLSchemaFactory.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public XMLSchemaFactory() {
    fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
    fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
    fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
    fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
    fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
    fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
    fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);
    fUseGrammarPoolOnly = true;

    // Enable secure processing feature by default
    fSecurityManager = new XMLSecurityManager(true);
    fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

    fSecurityPropertyMgr = new XMLSecurityPropertyManager();
    fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
            fSecurityPropertyMgr);

    // use catalog
    fXMLSchemaLoader.setFeature(XMLConstants.USE_CATALOG, JdkXmlUtils.USE_CATALOG_DEFAULT);
    for (Feature f : Feature.values()) {
        fXMLSchemaLoader.setProperty(f.getPropertyName(), null);
    }

    fXMLSchemaLoader.setProperty(JdkXmlUtils.CDATA_CHUNK_SIZE, JdkXmlUtils.CDATA_CHUNK_SIZE_DEFAULT);
    fXmlFeatures = new JdkXmlFeatures(fSecurityManager.isSecureProcessing());
    fOverrideDefaultParser = fXmlFeatures.getFeature(
            JdkXmlFeatures.XmlFeature.JDK_OVERRIDE_PARSER);
    fXMLSchemaLoader.setFeature(JdkXmlUtils.OVERRIDE_PARSER, fOverrideDefaultParser);
}
 
Example #12
Source File: XMLSchemaValidatorComponentManager.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
void setResourceResolver(LSResourceResolver resourceResolver) {
    fResourceResolver = resourceResolver;
    setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
}
 
Example #13
Source File: DOMConfigurationImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
           }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
       return getProperty(GRAMMAR_POOL);
   }
           else {
                   String msg =
                           DOMMessageFormatter.formatMessage(
                                   DOMMessageFormatter.DOM_DOMAIN,
                                   "FEATURE_NOT_FOUND",
                                   new Object[] { name });
                   throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }

   }
 
Example #14
Source File: DOMConfigurationImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
           }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
       return getProperty(GRAMMAR_POOL);
   }
           else {
                   String msg =
                           DOMMessageFormatter.formatMessage(
                                   DOMMessageFormatter.DOM_DOMAIN,
                                   "FEATURE_NOT_FOUND",
                                   new Object[] { name });
                   throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }

   }
 
Example #15
Source File: XMLSchemaValidatorComponentManager.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
void setResourceResolver(LSResourceResolver resourceResolver) {
    fResourceResolver = resourceResolver;
    setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
}
 
Example #16
Source File: XMLSchemaValidatorComponentManager.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
void setResourceResolver(LSResourceResolver resourceResolver) {
    fResourceResolver = resourceResolver;
    setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
}
 
Example #17
Source File: DOMConfigurationImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
           }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
       return getProperty(GRAMMAR_POOL);
   }
           else {
                   String msg =
                           DOMMessageFormatter.formatMessage(
                                   DOMMessageFormatter.DOM_DOMAIN,
                                   "FEATURE_NOT_FOUND",
                                   new Object[] { name });
                   throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }

   }
 
Example #18
Source File: XMLSchemaValidatorComponentManager.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
void setResourceResolver(LSResourceResolver resourceResolver) {
    fResourceResolver = resourceResolver;
    setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
}
 
Example #19
Source File: XMLSchemaValidatorComponentManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
void setResourceResolver(LSResourceResolver resourceResolver) {
    fResourceResolver = resourceResolver;
    setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
}
 
Example #20
Source File: DOMConfigurationImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
           }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
       return getProperty(GRAMMAR_POOL);
   }
           else {
                   String msg =
                           DOMMessageFormatter.formatMessage(
                                   DOMMessageFormatter.DOM_DOMAIN,
                                   "FEATURE_NOT_FOUND",
                                   new Object[] { name });
                   throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }

   }
 
Example #21
Source File: XMLSchemaValidatorComponentManager.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
void setResourceResolver(LSResourceResolver resourceResolver) {
    fResourceResolver = resourceResolver;
    setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
}
 
Example #22
Source File: DOMConfigurationImpl.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
       return fSchemaLocation;
           }
   else if (name.equalsIgnoreCase(ENTITY_RESOLVER)) {
       return getEntityResolver();
   }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)) {
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)) {
       return getProperty(GRAMMAR_POOL);
   }
   else if (name.equalsIgnoreCase(SECURITY_MANAGER)) {
       return getProperty(SECURITY_MANAGER);
   }
           else {
               throw newFeatureNotFoundError(name);
           }
   }
 
Example #23
Source File: DOMConfigurationImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
           }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
       return getProperty(GRAMMAR_POOL);
   }
           else {
                   String msg =
                           DOMMessageFormatter.formatMessage(
                                   DOMMessageFormatter.DOM_DOMAIN,
                                   "FEATURE_NOT_FOUND",
                                   new Object[] { name });
                   throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }

   }
 
Example #24
Source File: DOMConfigurationImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
           }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
       return getProperty(GRAMMAR_POOL);
   }
           else {
                   String msg =
                           DOMMessageFormatter.formatMessage(
                                   DOMMessageFormatter.DOM_DOMAIN,
                                   "FEATURE_NOT_FOUND",
                                   new Object[] { name });
                   throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }

   }
 
Example #25
Source File: XMLSchemaValidatorComponentManager.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
void setResourceResolver(LSResourceResolver resourceResolver) {
    fResourceResolver = resourceResolver;
    setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
}
 
Example #26
Source File: DOMConfigurationImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
           }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
       return getProperty(GRAMMAR_POOL);
   }
           else {
                   String msg =
                           DOMMessageFormatter.formatMessage(
                                   DOMMessageFormatter.DOM_DOMAIN,
                                   "FEATURE_NOT_FOUND",
                                   new Object[] { name });
                   throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }

   }
 
Example #27
Source File: XMLSchemaValidatorComponentManager.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
void setResourceResolver(LSResourceResolver resourceResolver) {
    fResourceResolver = resourceResolver;
    setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
}
 
Example #28
Source File: DOMConfigurationImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
           }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
       return getProperty(GRAMMAR_POOL);
   }
           else {
                   String msg =
                           DOMMessageFormatter.formatMessage(
                                   DOMMessageFormatter.DOM_DOMAIN,
                                   "FEATURE_NOT_FOUND",
                                   new Object[] { name });
                   throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }

   }
 
Example #29
Source File: XMLSchemaValidatorComponentManager.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
void setResourceResolver(LSResourceResolver resourceResolver) {
    fResourceResolver = resourceResolver;
    setProperty(ENTITY_RESOLVER, new DOMEntityResolverWrapper(resourceResolver));
}
 
Example #30
Source File: DOMConfigurationImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
* DOM Level 3 WD - Experimental.
* getParameter
*/
   public Object getParameter(String name) throws DOMException {

           // REVISIT: Recognizes DOM L3 default features only.
           //          Does not yet recognize Xerces features.

           if (name.equalsIgnoreCase(Constants.DOM_COMMENTS)) {
                   return ((features & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACES)) {
                   return (features & NAMESPACES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_DATATYPE_NORMALIZATION)) {
                   // REVISIT: datatype-normalization only takes effect if validation is on
                   return (features & DTNORMALIZATION) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_CDATA_SECTIONS)) {
                   return (features & CDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ENTITIES)) {
                   return (features & ENTITIES) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SPLIT_CDATA)) {
                   return (features & SPLITCDATA) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_VALIDATE)) {
                   return (features & VALIDATE) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_WELLFORMED)) {
                   return (features & WELLFORMED) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NAMESPACE_DECLARATIONS)) {
               return (features & NSDECL) != 0 ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_INFOSET)) {
                   return (features & INFOSET_MASK) == INFOSET_TRUE_PARAMS ? Boolean.TRUE : Boolean.FALSE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_NORMALIZE_CHARACTERS)
                           || name.equalsIgnoreCase(Constants.DOM_CANONICAL_FORM)
                           || name.equalsIgnoreCase(Constants.DOM_VALIDATE_IF_SCHEMA)
                           || name.equalsIgnoreCase(Constants.DOM_CHECK_CHAR_NORMALIZATION)
           ) {
                   return Boolean.FALSE;
           }
   else if (name.equalsIgnoreCase(SEND_PSVI)) {
       return Boolean.TRUE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_PSVI)) {
       return (features & PSVI) != 0 ? Boolean.TRUE : Boolean.FALSE;
   }
   else if (name.equalsIgnoreCase(Constants.DOM_ELEMENT_CONTENT_WHITESPACE)) {
                   return Boolean.TRUE;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
       return fErrorHandlerWrapper.getErrorHandler();
           }
           else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
                   XMLEntityResolver entityResolver = getEntityResolver();
                   if (entityResolver != null && entityResolver instanceof DOMEntityResolverWrapper) {
                           return ((DOMEntityResolverWrapper) entityResolver).getEntityResolver();
                   }
                   return null;
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_TYPE)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE);
           }
           else if (name.equalsIgnoreCase(Constants.DOM_SCHEMA_LOCATION)) {
                   return getProperty(Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE);
           }
   else if (name.equalsIgnoreCase(SYMBOL_TABLE)){
       return getProperty(SYMBOL_TABLE);
   }
   else if (name.equalsIgnoreCase(GRAMMAR_POOL)){
       return getProperty(GRAMMAR_POOL);
   }
           else {
                   String msg =
                           DOMMessageFormatter.formatMessage(
                                   DOMMessageFormatter.DOM_DOMAIN,
                                   "FEATURE_NOT_FOUND",
                                   new Object[] { name });
                   throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }

   }