当前位置: 首页>>代码示例>>Java>>正文


Java XMLConfigurationException类代码示例

本文整理汇总了Java中com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException的典型用法代码示例。如果您正苦于以下问题:Java XMLConfigurationException类的具体用法?Java XMLConfigurationException怎么用?Java XMLConfigurationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XMLConfigurationException类属于com.sun.org.apache.xerces.internal.xni.parser包,在下文中一共展示了XMLConfigurationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEntityResolver

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
/**
 * Return the current entity resolver.
 *
 * @return The current entity resolver, or null if none
 *         has been registered.
 * @see #setEntityResolver
 */
public EntityResolver getEntityResolver() {

    EntityResolver entityResolver = null;
    try {
        XMLEntityResolver xmlEntityResolver =
            (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
        if (xmlEntityResolver != null) {
            if (xmlEntityResolver instanceof EntityResolverWrapper) {
                entityResolver =
                    ((EntityResolverWrapper) xmlEntityResolver).getEntityResolver();
            }
            else if (xmlEntityResolver instanceof EntityResolver2Wrapper) {
                entityResolver =
                    ((EntityResolver2Wrapper) xmlEntityResolver).getEntityResolver();
            }
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return entityResolver;

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:AbstractSAXParser.java

示例2: checkFeature

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
/**
 * Check a feature. If feature is know and supported, this method simply
 * returns. Otherwise, the appropriate exception is thrown.
 *
 * @param featureId The unique identifier (URI) of the feature.
 *
 * @throws XMLConfigurationException Thrown for configuration error.
 *                                   In general, components should
 *                                   only throw this exception if
 *                                   it is <strong>really</strong>
 *                                   a critical error.
 */
protected FeatureState checkFeature(String featureId)
    throws XMLConfigurationException {

    //
    // Xerces Features
    //
    if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
        final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();

        //
        // special performance feature: no one by component manager is allowed to set it
        //
        if (suffixLength == Constants.PARSER_SETTINGS.length() &&
            featureId.endsWith(Constants.PARSER_SETTINGS)) {
            return FeatureState.NOT_SUPPORTED;
        }
    }

    return super.checkFeature(featureId);
 }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:BasicParserConfiguration.java

示例3: getErrorHandler

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
/**
 * Return the current error handler.
 *
 * @return The current error handler, or null if none
 *         has been registered.
 * @see #setErrorHandler
 */
public ErrorHandler getErrorHandler() {

    ErrorHandler errorHandler = null;
    try {
        XMLErrorHandler xmlErrorHandler =
            (XMLErrorHandler)fConfiguration.getProperty(ERROR_HANDLER);
        if (xmlErrorHandler != null &&
            xmlErrorHandler instanceof ErrorHandlerWrapper) {
            errorHandler = ((ErrorHandlerWrapper)xmlErrorHandler).getErrorHandler();
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }
    return errorHandler;

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:DOMParser.java

示例4: copyFeatures1

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
private void copyFeatures1(
    Enumeration features,
    String featurePrefix,
    XMLComponentManager from,
    XMLParserConfiguration to) {
    while (features.hasMoreElements()) {
        String featureId = featurePrefix + (String)features.nextElement();
        boolean value = from.getFeature(featureId);

        try {
            to.setFeature(featureId, value);
        }
        catch (XMLConfigurationException e) {
            // componentManager doesn't support this feature,
            // so we won't worry about it
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:XIncludeHandler.java

示例5: getFeatureState

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
/**
 * Returns the state of a feature.
 *
 * @param featureId The feature identifier.
 * @return true if the feature is supported
 *
 * @throws XMLConfigurationException Thrown for configuration error.
 *                                   In general, components should
 *                                   only throw this exception if
 *                                   it is <strong>really</strong>
 *                                   a critical error.
 */
public FeatureState getFeatureState(String featureId)
        throws XMLConfigurationException {
    if (PARSER_SETTINGS.equals(featureId)) {
        return FeatureState.is(fConfigUpdated);
    }
    else if (VALIDATION.equals(featureId) || SCHEMA_VALIDATION.equals(featureId)) {
        return FeatureState.is(true);
    }
    else if (USE_GRAMMAR_POOL_ONLY.equals(featureId)) {
        return FeatureState.is(fUseGrammarPoolOnly);
    }
    else if (XMLConstants.FEATURE_SECURE_PROCESSING.equals(featureId)) {
        return FeatureState.is(fInitSecurityManager.isSecureProcessing());
    }
    else if (SCHEMA_ELEMENT_DEFAULT.equals(featureId)) {
        return FeatureState.is(true); //pre-condition: VALIDATION and SCHEMA_VALIDATION are always true
    }
    return super.getFeatureState(featureId);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:XMLSchemaValidatorComponentManager.java

示例6: setProperty

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
/**
 * Sets the value of a property during parsing.
 *
 * @param propertyId
 * @param value
 */
public void setProperty(String propertyId, Object value)
    throws XMLConfigurationException {

    // Xerces properties
    if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
            final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();

        if (suffixLength == Constants.SYMBOL_TABLE_PROPERTY.length() &&
            propertyId.endsWith(Constants.SYMBOL_TABLE_PROPERTY)) {
            fSymbolTable = (SymbolTable)value;
        }
        else if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() &&
            propertyId.endsWith(Constants.ERROR_REPORTER_PROPERTY)) {
            fErrorReporter = (XMLErrorReporter)value;
        }
        return;
    }

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:XMLNamespaceBinder.java

示例7: setProperty

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
/**
 * Sets the value of a property. This method is called by the component
 * manager any time after reset when a property changes value.
 * <p>
 * <strong>Note:</strong> Components should silently ignore properties
 * that do not affect the operation of the component.
 *
 * @param propertyId The property identifier.
 * @param value      The value of the property.
 *
 * @throws SAXNotRecognizedException The component should not throw
 *                                   this exception.
 * @throws SAXNotSupportedException The component should not throw
 *                                  this exception.
 */
public void setProperty(String propertyId, Object value)
    throws XMLConfigurationException {

    //
    // Xerces properties
    //

    if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
        final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();

        if (suffixLength == Constants.ERROR_HANDLER_PROPERTY.length() &&
            propertyId.endsWith(Constants.ERROR_HANDLER_PROPERTY)) {
            fErrorHandler = (XMLErrorHandler)value;
        }
    }

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:XMLErrorReporter.java

示例8: getProperty

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
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}));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:ValidatorImpl.java

示例9: getFeature

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
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}));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ValidatorHandlerImpl.java

示例10: setFeature

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
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}));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:ValidatorHandlerImpl.java

示例11: getProperty

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
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}));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ValidatorHandlerImpl.java

示例12: checkProperty

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
/**
 * Check a property. If the property is known and supported, this method
 * simply returns. Otherwise, the appropriate exception is thrown.
 *
 * @param propertyId The unique identifier (URI) of the property
 *                   being set.
 * @return the PropertyState
 * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
 *            requested feature is not known.
 */
protected PropertyState checkProperty(String propertyId)
    throws XMLConfigurationException {

    // check property
    if (!fRecognizedProperties.contains(propertyId)) {
        if (fParentSettings != null) {
            PropertyState state = fParentSettings.getPropertyState(propertyId);
            if (state.isExceptional()) {
                return state;
            }
        }
        else {
            return PropertyState.NOT_RECOGNIZED;
        }
    }
    return PropertyState.RECOGNIZED;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:ParserConfigurationSettings.java

示例13: setErrorHandler

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
/**
 * Allow an application to register an error event handler.
 *
 * <p>If the application does not register an error handler, all
 * error events reported by the SAX parser will be silently
 * ignored; however, normal processing may not continue.  It is
 * highly recommended that all SAX applications implement an
 * error handler to avoid unexpected bugs.</p>
 *
 * <p>Applications may register a new or different handler in the
 * middle of a parse, and the SAX parser must begin using the new
 * handler immediately.</p>
 *
 * @param errorHandler The error handler.
 * @see #getErrorHandler
 */
public void setErrorHandler(ErrorHandler errorHandler) {

    try {
        XMLErrorHandler xeh = (XMLErrorHandler) fConfiguration.getProperty(ERROR_HANDLER);
        if (xeh instanceof ErrorHandlerWrapper) {
            ErrorHandlerWrapper ehw = (ErrorHandlerWrapper) xeh;
            ehw.setErrorHandler(errorHandler);
        }
        else {
            fConfiguration.setProperty(ERROR_HANDLER,
                    new ErrorHandlerWrapper(errorHandler));
        }
    }
    catch (XMLConfigurationException e) {
        // do nothing
    }

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:35,代码来源:AbstractSAXParser.java

示例14: setSchemaValidatorProperty

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
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}));
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:SAXParserImpl.java

示例15: setFeature

import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入依赖的package包/类
/**
 * Sets the state of a feature. This method is called by the component
 * manager any time after reset when a feature changes state.
 * <p>
 * <strong>Note:</strong> Components should silently ignore features
 * that do not affect the operation of the component.
 *
 * @param featureId The feature identifier.
 * @param state     The state of the feature.
 *
 * @throws SAXNotRecognizedException The component should not throw
 *                                   this exception.
 * @throws SAXNotSupportedException The component should not throw
 *                                  this exception.
 */
public void setFeature(String featureId, boolean state)
throws XMLConfigurationException {

    super.setFeature(featureId, state);

    // Xerces properties
    if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
        final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();

        if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
            featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
            fLoadExternalDTD = state;
            return;
        }
        else if (suffixLength == Constants.DISALLOW_DOCTYPE_DECL_FEATURE.length() &&
            featureId.endsWith(Constants.DISALLOW_DOCTYPE_DECL_FEATURE)) {
            fDisallowDoctype = state;
            return;
        }
    }

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:38,代码来源:XMLDocumentScannerImpl.java


注:本文中的com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。