Example usage for org.xml.sax SAXNotRecognizedException SAXNotRecognizedException

List of usage examples for org.xml.sax SAXNotRecognizedException SAXNotRecognizedException

Introduction

In this page you can find the example usage for org.xml.sax SAXNotRecognizedException SAXNotRecognizedException.

Prototype

public SAXNotRecognizedException(String message) 

Source Link

Document

Construct a new exception with the given message.

Usage

From source file:nl.nn.adapterframework.validation.xerces_2_11.XMLSchemaFactory.java

public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException(JAXPValidationMessageFormatter
                .formatMessage(fXMLSchemaLoader.getLocale(), "FeatureNameNull", null));
    }/*from w  ww . j a va 2s. c  o  m*/
    if (name.startsWith(JAXP_SOURCE_FEATURE_PREFIX)) {
        // Indicates to the caller that this SchemaFactory supports a specific JAXP Source.
        if (name.equals(StreamSource.FEATURE) || name.equals(SAXSource.FEATURE)
                || name.equals(DOMSource.FEATURE) || name.equals(StAXSource.FEATURE)) {
            return true;
        }
    }
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return (fSecurityManager != null);
    } else if (name.equals(USE_GRAMMAR_POOL_ONLY)) {
        return fUseGrammarPoolOnly;
    }
    try {
        return fXMLSchemaLoader.getFeature(name);
    } catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                    "feature-not-recognized", new Object[] { identifier }));
        } else {
            throw new SAXNotSupportedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                    "feature-not-supported", new Object[] { identifier }));
        }
    }
}

From source file:nl.nn.adapterframework.validation.xerces_2_11.XMLSchemaFactory.java

public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException(JAXPValidationMessageFormatter
                .formatMessage(fXMLSchemaLoader.getLocale(), "ProperyNameNull", null));
    }/*from   ww w.  j  a v  a 2s.  c om*/
    if (name.equals(SECURITY_MANAGER)) {
        return fSecurityManager;
    } else if (name.equals(XMLGRAMMAR_POOL)) {
        throw new SAXNotSupportedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                "property-not-supported", new Object[] { name }));
    }
    try {
        return fXMLSchemaLoader.getProperty(name);
    } catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                    "property-not-recognized", new Object[] { identifier }));
        } else {
            throw new SAXNotSupportedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                    "property-not-supported", new Object[] { identifier }));
        }
    }
}

From source file:nl.nn.adapterframework.validation.xerces_2_11.XMLSchemaFactory.java

public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException(JAXPValidationMessageFormatter
                .formatMessage(fXMLSchemaLoader.getLocale(), "FeatureNameNull", null));
    }//from ww w. j  a v a 2s  .c  om
    if (name.startsWith(JAXP_SOURCE_FEATURE_PREFIX)) {
        if (name.equals(StreamSource.FEATURE) || name.equals(SAXSource.FEATURE)
                || name.equals(DOMSource.FEATURE) || name.equals(StAXSource.FEATURE)) {
            throw new SAXNotSupportedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                    "feature-read-only", new Object[] { name }));
        }
    }
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        fSecurityManager = value ? new SecurityManager() : null;
        fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
        return;
    } else if (name.equals(USE_GRAMMAR_POOL_ONLY)) {
        fUseGrammarPoolOnly = value;
        return;
    }
    try {
        fXMLSchemaLoader.setFeature(name, value);
    } catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                    "feature-not-recognized", new Object[] { identifier }));
        } else {
            throw new SAXNotSupportedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                    "feature-not-supported", new Object[] { identifier }));
        }
    }
}

From source file:nl.nn.adapterframework.validation.xerces_2_11.XMLSchemaFactory.java

public void setProperty(String name, Object object) throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException(JAXPValidationMessageFormatter
                .formatMessage(fXMLSchemaLoader.getLocale(), "ProperyNameNull", null));
    }//from  www  . ja va2s .  co m
    if (name.equals(SECURITY_MANAGER)) {
        fSecurityManager = (SecurityManager) object;
        fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
        return;
    } else if (name.equals(XMLGRAMMAR_POOL)) {
        throw new SAXNotSupportedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                "property-not-supported", new Object[] { name }));
    }
    try {
        fXMLSchemaLoader.setProperty(name, object);
    } catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                    "property-not-recognized", new Object[] { identifier }));
        } else {
            throw new SAXNotSupportedException(SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                    "property-not-supported", new Object[] { identifier }));
        }
    }
}

From source file:org.xchain.framework.sax.CommandXmlReader.java

public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    throw new SAXNotRecognizedException("Property '" + name + "' is not supported.");
}

From source file:org.xchain.framework.sax.CommandXmlReader.java

public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    throw new SAXNotRecognizedException("Property '" + name + "' is not supported.");
}

From source file:org.xchain.framework.sax.CommandXmlReader.java

public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
    throw new SAXNotRecognizedException("Property '" + name + "' is not supported.");
}

From source file:org.xchain.framework.sax.CommandXmlReader.java

public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
    throw new SAXNotRecognizedException("Property '" + name + "' is not supported.");
}