• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SAXMessageFormatter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: newDocumentBuilder

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的package包/类
/**
 * Creates a new instance of a {@link javax.xml.parsers.DocumentBuilder}
 * using the currently configured parameters.
 */
public DocumentBuilder newDocumentBuilder()
    throws ParserConfigurationException
{
    /** Check that if a Schema has been specified that neither of the schema properties have been set. */
    if (grammar != null && attributes != null) {
        if (attributes.containsKey(JAXPConstants.JAXP_SCHEMA_LANGUAGE)) {
            throw new ParserConfigurationException(
                    SAXMessageFormatter.formatMessage(null,
                    "schema-already-specified", new Object[] {JAXPConstants.JAXP_SCHEMA_LANGUAGE}));
        }
        else if (attributes.containsKey(JAXPConstants.JAXP_SCHEMA_SOURCE)) {
            throw new ParserConfigurationException(
                    SAXMessageFormatter.formatMessage(null,
                    "schema-already-specified", new Object[] {JAXPConstants.JAXP_SCHEMA_SOURCE}));
        }
    }

    try {
        return new DocumentBuilderImpl(this, attributes, features, fSecureProcess);
    } catch (SAXException se) {
        // Handles both SAXNotSupportedException, SAXNotRecognizedException
        throw new ParserConfigurationException(se.getMessage());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:DocumentBuilderFactoryImpl.java


示例2: setProperty0

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的package包/类
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}));
        }
    }

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


示例3: getFeature

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的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,代码来源:ValidatorImpl.java


示例4: getProperty

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的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


示例5: setProperty

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


示例6: getFeature

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


示例7: setFeature

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的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


示例8: getProperty

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的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


示例9: setProperty

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


示例10: setSchemaValidatorFeature

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


示例11: setSchemaValidatorProperty

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的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


示例12: error

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的package包/类
public void error(SAXParseException e) throws SAXException {
    if (errorCount >= ERROR_COUNT_LIMIT) {
        // Ignore all errors after reaching the limit
        return;
    } else if (errorCount == 0) {
        // Print a warning before the first error
        System.err.println(SAXMessageFormatter.formatMessage(locale,
                    "errorHandlerNotSet", new Object [] {errorCount}));
    }

    String systemId = e.getSystemId();
    if (systemId == null) {
        systemId = "null";
    }
    String message = "Error: URI=" + systemId +
        " Line=" + e.getLineNumber() +
        ": " + e.getMessage();
    System.err.println(message);
    errorCount++;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:DefaultValidationErrorHandler.java


示例13: getFeature

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的package包/类
@Override
public boolean getFeature(String name)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    if (name == null) {
        throw new NullPointerException();
    }
    try {
        return fComponentManager.getFeature(name);
    }
    catch (XMLConfigurationException e) {
        final String identifier = e.getIdentifier();
        final String key = e.getType() == Status.NOT_RECOGNIZED ?
                "feature-not-recognized" : "feature-not-supported";
        throw new SAXNotRecognizedException(
                SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
                key, new Object [] {identifier}));
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:ValidatorImpl.java


示例14: getProperty

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的package包/类
@Override
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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:ValidatorImpl.java


示例15: setProperty

import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; //导入依赖的package包/类
@Override
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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:ValidatorImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BucketSettings类代码示例发布时间:2022-05-23
下一篇:
Java IPreferenceStoreAccess类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap