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

The following examples show how to use com.sun.org.apache.xerces.internal.util.Status. 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: DOMParser.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void setProperty0(String propertyId, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fConfiguration.setProperty(propertyId, value);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }

}
 
Example #2
Source File: ValidatorHandlerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public Object getProperty(String name)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException();
    }
    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}));
    }
}
 
Example #3
Source File: ValidatorHandlerImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public void setFeature(String name, boolean value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException();
    }
    try {
        fComponentManager.setFeature(name, value);
    }
    catch (XMLConfigurationException e) {
        final String identifier = e.getIdentifier();
        final String key;
        if (e.getType() == Status.NOT_ALLOWED) {
            //for now, the identifier can only be (XMLConstants.FEATURE_SECURE_PROCESSING)
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                "jaxp-secureprocessing-feature", null));
        } else if (e.getType() == Status.NOT_RECOGNIZED) {
            key = "feature-not-recognized";
        } else {
            key = "feature-not-supported";
        }
        throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                key, new Object [] {identifier}));
    }
}
 
Example #4
Source File: ValidatorImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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}));
    }
    fConfigurationChanged = true;
}
 
Example #5
Source File: SAXParserImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void setSchemaValidatorProperty(String name, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fSAXParser.fSchemaValidator.setProperty(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(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }
}
 
Example #6
Source File: SAXParserImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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}));
        }
    }
}
 
Example #7
Source File: DOMParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void setProperty0(String propertyId, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fConfiguration.setProperty(propertyId, value);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }

}
 
Example #8
Source File: ValidatorImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
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}));
    }
}
 
Example #9
Source File: XMLSchemaFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                "FeatureNameNull", null));
    }
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return (fSecurityManager != null && fSecurityManager.isSecureProcessing());
    }
    try {
        return fXMLSchemaLoader.getFeature(name);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.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}));
        }
    }
}
 
Example #10
Source File: ValidatorImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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}));
    }
    fConfigurationChanged = true;
}
 
Example #11
Source File: ValidatorHandlerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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}));
    }
}
 
Example #12
Source File: XMLDTDLoader.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the state of a property.
 *
 * @param propertyId The property identifier.
 *
 * @throws XMLConfigurationException Thrown on configuration error.
 */
public Object getProperty(String propertyId)
        throws XMLConfigurationException {
    if (propertyId.equals(SYMBOL_TABLE)) {
        return fSymbolTable;
    }
    else if (propertyId.equals(ERROR_REPORTER)) {
        return fErrorReporter;
    }
    else if (propertyId.equals(ERROR_HANDLER)) {
        return fErrorReporter.getErrorHandler();
    }
    else if (propertyId.equals(ENTITY_RESOLVER)) {
        return fEntityResolver;
    }
    else if (propertyId.equals(LOCALE)) {
        return getLocale();
    }
    else if (propertyId.equals(GRAMMAR_POOL)) {
        return fGrammarPool;
    }
    else if (propertyId.equals(DTD_VALIDATOR)) {
        return fValidator;
    }
    throw new XMLConfigurationException(Status.NOT_RECOGNIZED, propertyId);
}
 
Example #13
Source File: XMLDTDLoader.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the state of a property.
 *
 * @param propertyId The property identifier.
 *
 * @throws XMLConfigurationException Thrown on configuration error.
 */
public Object getProperty(String propertyId)
        throws XMLConfigurationException {
    if (propertyId.equals(SYMBOL_TABLE)) {
        return fSymbolTable;
    }
    else if (propertyId.equals(ERROR_REPORTER)) {
        return fErrorReporter;
    }
    else if (propertyId.equals(ERROR_HANDLER)) {
        return fErrorReporter.getErrorHandler();
    }
    else if (propertyId.equals(ENTITY_RESOLVER)) {
        return fEntityResolver;
    }
    else if (propertyId.equals(LOCALE)) {
        return getLocale();
    }
    else if (propertyId.equals(GRAMMAR_POOL)) {
        return fGrammarPool;
    }
    else if (propertyId.equals(DTD_VALIDATOR)) {
        return fValidator;
    }
    throw new XMLConfigurationException(Status.NOT_RECOGNIZED, propertyId);
}
 
Example #14
Source File: XMLDTDLoader.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the state of a feature.
 *
 * @param featureId The feature identifier.
 *
 * @throws XMLConfigurationException Thrown on configuration error.
 */
public boolean getFeature(String featureId)
        throws XMLConfigurationException {
    if (featureId.equals(VALIDATION)) {
        return fValidation;
    }
    else if (featureId.equals(WARN_ON_DUPLICATE_ATTDEF)) {
        return fWarnDuplicateAttdef;
    }
    else if (featureId.equals(WARN_ON_UNDECLARED_ELEMDEF)) {
        return fWarnOnUndeclaredElemdef;
    }
    else if (featureId.equals(NOTIFY_CHAR_REFS)) {
        return fDTDScanner.getFeature(featureId);
    }
    else if (featureId.equals(STANDARD_URI_CONFORMANT_FEATURE)) {
        return fStrictURI;
    }
    else if (featureId.equals(BALANCE_SYNTAX_TREES)) {
        return fBalanceSyntaxTrees;
    }
    throw new XMLConfigurationException(Status.NOT_RECOGNIZED, featureId);
}
 
Example #15
Source File: DOMParser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void setProperty0(String propertyId, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fConfiguration.setProperty(propertyId, value);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }

}
 
Example #16
Source File: SAXParserImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void setSchemaValidatorProperty(String name, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fSAXParser.fSchemaValidator.setProperty(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(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }
}
 
Example #17
Source File: ValidatorHandlerImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public Object getProperty(String name)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException();
    }
    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}));
    }
}
 
Example #18
Source File: DOMParser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void setProperty0(String propertyId, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fConfiguration.setProperty(propertyId, value);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }

}
 
Example #19
Source File: XMLDTDLoader.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the state of a feature.
 *
 * @param featureId The feature identifier.
 *
 * @throws XMLConfigurationException Thrown on configuration error.
 */
public boolean getFeature(String featureId)
        throws XMLConfigurationException {
    if (featureId.equals(VALIDATION)) {
        return fValidation;
    }
    else if (featureId.equals(WARN_ON_DUPLICATE_ATTDEF)) {
        return fWarnDuplicateAttdef;
    }
    else if (featureId.equals(WARN_ON_UNDECLARED_ELEMDEF)) {
        return fWarnOnUndeclaredElemdef;
    }
    else if (featureId.equals(NOTIFY_CHAR_REFS)) {
        return fDTDScanner.getFeature(featureId);
    }
    else if (featureId.equals(STANDARD_URI_CONFORMANT_FEATURE)) {
        return fStrictURI;
    }
    else if (featureId.equals(BALANCE_SYNTAX_TREES)) {
        return fBalanceSyntaxTrees;
    }
    throw new XMLConfigurationException(Status.NOT_RECOGNIZED, featureId);
}
 
Example #20
Source File: DOMParser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void setProperty0(String propertyId, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fConfiguration.setProperty(propertyId, value);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }

}
 
Example #21
Source File: ValidatorImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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}));
    }
}
 
Example #22
Source File: ValidatorImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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}));
    }
    fConfigurationChanged = true;
}
 
Example #23
Source File: XMLSchemaFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public boolean getFeature(String name)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
                "FeatureNameNull", null));
    }
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return (fSecurityManager != null && fSecurityManager.isSecureProcessing());
    }
    try {
        return fXMLSchemaLoader.getFeature(name);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.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}));
        }
    }
}
 
Example #24
Source File: ValidatorHandlerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void setFeature(String name, boolean value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException();
    }
    try {
        fComponentManager.setFeature(name, value);
    }
    catch (XMLConfigurationException e) {
        final String identifier = e.getIdentifier();
        final String key;
        if (e.getType() == Status.NOT_ALLOWED) {
            //for now, the identifier can only be (XMLConstants.FEATURE_SECURE_PROCESSING)
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                "jaxp-secureprocessing-feature", null));
        } else if (e.getType() == Status.NOT_RECOGNIZED) {
            key = "feature-not-recognized";
        } else {
            key = "feature-not-supported";
        }
        throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                key, new Object [] {identifier}));
    }
}
 
Example #25
Source File: DOMParser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void setProperty0(String propertyId, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fConfiguration.setProperty(propertyId, value);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }

}
 
Example #26
Source File: ValidatorHandlerImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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}));
    }
}
 
Example #27
Source File: SAXParserImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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}));
        }
    }
}
 
Example #28
Source File: ValidatorHandlerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void setFeature(String name, boolean value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException();
    }
    try {
        fComponentManager.setFeature(name, value);
    }
    catch (XMLConfigurationException e) {
        final String identifier = e.getIdentifier();
        final String key;
        if (e.getType() == Status.NOT_ALLOWED) {
            //for now, the identifier can only be (XMLConstants.FEATURE_SECURE_PROCESSING)
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                "jaxp-secureprocessing-feature", null));
        } else if (e.getType() == Status.NOT_RECOGNIZED) {
            key = "feature-not-recognized";
        } else {
            key = "feature-not-supported";
        }
        throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                key, new Object [] {identifier}));
    }
}
 
Example #29
Source File: SAXParserImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void setSchemaValidatorProperty(String name, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fSAXParser.fSchemaValidator.setProperty(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(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }
}
 
Example #30
Source File: DOMParser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void setProperty0(String propertyId, Object value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    try {
        fConfiguration.setProperty(propertyId, value);
    }
    catch (XMLConfigurationException e) {
        String identifier = e.getIdentifier();
        if (e.getType() == Status.NOT_RECOGNIZED) {
            throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-recognized", new Object [] {identifier}));
        }
        else {
            throw new SAXNotSupportedException(
                SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
                "property-not-supported", new Object [] {identifier}));
        }
    }

}