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


Java XSMessageFormatter类代码示例

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


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

示例1: SchemaValidatorConfiguration

import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; //导入依赖的package包/类
public SchemaValidatorConfiguration(XMLComponentManager parentManager,
        XSGrammarPoolContainer grammarContainer, ValidationManager validationManager) {
    fParentComponentManager = parentManager;
    fGrammarPool = grammarContainer.getGrammarPool();
    fUseGrammarPoolOnly = grammarContainer.isFullyComposed();
    fValidationManager = validationManager;
    // add schema message formatter to error reporter
    try {
        XMLErrorReporter errorReporter = (XMLErrorReporter) fParentComponentManager.getProperty(ERROR_REPORTER);
        if (errorReporter != null) {
            errorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
        }
    }
    // Ignore exception.
    catch (XMLConfigurationException exc) {}
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:SchemaValidatorConfiguration.java

示例2: parseXMLSchema

import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; //导入依赖的package包/类
SchemaGrammar parseXMLSchema(XMLInputSource is)
            throws IOException {
    XMLEntityResolver resolver = getEntityResolver();
    if(resolver != null) {
        fSchemaLoader.setEntityResolver(resolver);
    }
    if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
        fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
    }
    fSchemaLoader.setProperty(ERROR_REPORTER, fErrorReporter);

    String propPrefix = Constants.XERCES_PROPERTY_PREFIX;
    String propName = propPrefix + Constants.SCHEMA_LOCATION;
    fSchemaLoader.setProperty(propName, getProperty(propName));
    propName = propPrefix + Constants.SCHEMA_NONS_LOCATION;
    fSchemaLoader.setProperty(propName, getProperty(propName));
    propName = Constants.JAXP_PROPERTY_PREFIX+Constants.SCHEMA_SOURCE;
    fSchemaLoader.setProperty(propName, getProperty(propName));
    fSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, getFeature(SCHEMA_FULL_CHECKING));

    // Should check whether the grammar with this namespace is already in
    // the grammar resolver. But since we don't know the target namespace
    // of the document here, we leave such check to XSDHandler
    SchemaGrammar grammar = (SchemaGrammar)fSchemaLoader.loadGrammar(is);
    // by default, hand it off to the grammar pool
    if (grammar != null) {
        fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA,
                                  new Grammar[]{grammar});
    }

    return grammar;

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

示例3: reportSchemaErr

import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; //导入依赖的package包/类
void reportSchemaErr(String key, Object[] args, Element ele, short type, Exception exception) {
    if (element2Locator(ele, xl)) {
        fErrorReporter.reportError(xl, XSMessageFormatter.SCHEMA_DOMAIN,
                key, args, type, exception);
    }
    else {
        fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
                key, args, type, exception);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:XSDHandler.java

示例4: characters

import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; //导入依赖的package包/类
/**
 * Character content.
 *
 * @param text   The content.
 * @param augs   Additional information that may include infoset augmentations
 *
 * @exception XNIException
 *                   Thrown by handler to signal an error.
 */
public void characters(XMLString text, Augmentations augs) throws XNIException {
    // when it's not within xs:appinfo or xs:documentation
    if (fInnerAnnotationDepth == -1 ) {
        for (int i=text.offset; i<text.offset+text.length; i++) {
            // and there is a non-whitespace character
            if (!XMLChar.isSpace(text.ch[i])) {
                // the string we saw: starting from the first non-whitespace character.
                String txt = new String(text.ch, i, text.length+text.offset-i);
                // report an error
                fErrorReporter.reportError(fLocator,
                        XSMessageFormatter.SCHEMA_DOMAIN,
                        "s4s-elt-character",
                        new Object[]{txt},
                        XMLErrorReporter.SEVERITY_ERROR);
                break;
            }
        }
        // don't call super.characters() when it's not within one of the 2
        // annotation elements: the traversers ignore them anyway. We can
        // save time/memory creating the text nodes.
    }
    // when it's within either of the 2 elements, characters are allowed
    // and we need to store them.
    else {
        schemaDOM.characters(text);
    }

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

示例5: nodeCountCheck

import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; //导入依赖的package包/类
public void nodeCountCheck(){
    if( fSecurityManager != null && !fSecurityManager.isNoLimit(maxNodeLimit) &&
            nodeCount++ > maxNodeLimit){
        if(DEBUG){
            System.out.println("nodeCount = " + nodeCount ) ;
            System.out.println("nodeLimit = " + maxNodeLimit ) ;
        }
        fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "maxOccurLimit", new Object[]{ new Integer(maxNodeLimit) }, XMLErrorReporter.SEVERITY_FATAL_ERROR);
        // similarly to entity manager behaviour, take into accont
        // behaviour if continue-after-fatal-error is set.
        nodeCount = 0;
    }

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

示例6: nodeCountCheck

import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; //导入依赖的package包/类
public void nodeCountCheck(){
    if( fSecurityManager != null && !fSecurityManager.isNoLimit(maxNodeLimit) &&
            nodeCount++ > maxNodeLimit){
        if(DEBUG){
            System.out.println("nodeCount = " + nodeCount ) ;
            System.out.println("nodeLimit = " + maxNodeLimit ) ;
        }
        fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "MaxOccurLimit", new Object[]{ maxNodeLimit }, XMLErrorReporter.SEVERITY_FATAL_ERROR);
        // similarly to entity manager behaviour, take into accont
        // behaviour if continue-after-fatal-error is set.
        nodeCount = 0;
    }

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

示例7: nodeCountCheck

import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; //导入依赖的package包/类
public void nodeCountCheck(){
    if( fSecurityManager != null && !fSecurityManager.isNoLimit(maxNodeLimit) &&
            nodeCount++ > maxNodeLimit){
        if(DEBUG){
            System.out.println("nodeCount = " + nodeCount ) ;
            System.out.println("nodeLimit = " + maxNodeLimit ) ;
        }
        fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "MaxOccurLimit", new Object[]{ new Integer(maxNodeLimit) }, XMLErrorReporter.SEVERITY_FATAL_ERROR);
        // similarly to entity manager behaviour, take into accont
        // behaviour if continue-after-fatal-error is set.
        nodeCount = 0;
    }

}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:15,代码来源:CMNodeFactory.java


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