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

Java XMLSchemaException类代码示例

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

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



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

示例1: checkUniqueParticleAttribution

import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException; //导入依赖的package包/类
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
    // check whether there is conflict between any two leaves
    for (int i = 0; i < fNumElements; i++) {
        for (int j = i+1; j < fNumElements; j++) {
            if (XSConstraints.overlapUPA(fAllElements[i], fAllElements[j], subGroupHandler)) {
                // REVISIT: do we want to report all errors? or just one?
                throw new XMLSchemaException("cos-nonambig", new Object[]{fAllElements[i].toString(),
                                                                          fAllElements[j].toString()});
            }
        }
    }

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


示例2: XSDocumentInfo

import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException; //导入依赖的package包/类
XSDocumentInfo (Element schemaRoot, XSAttributeChecker attrChecker, SymbolTable symbolTable)
                throws XMLSchemaException {
    fSchemaElement = schemaRoot;
    initNamespaceSupport(schemaRoot);
    fIsChameleonSchema = false;

    fSymbolTable = symbolTable;
    fAttrChecker = attrChecker;

    if (schemaRoot != null) {
        Element root = schemaRoot;
        fSchemaAttrs = attrChecker.checkAttributes(root, true, this);
        // schemaAttrs == null means it's not an <xsd:schema> element
        // throw an exception, but we don't know the document systemId,
        // so we leave that to the caller.
        if (fSchemaAttrs == null) {
            throw new XMLSchemaException(null, null);
        }
        fAreLocalAttributesQualified =
            ((XInt)fSchemaAttrs[XSAttributeChecker.ATTIDX_AFORMDEFAULT]).intValue() == SchemaSymbols.FORM_QUALIFIED;
        fAreLocalElementsQualified =
            ((XInt)fSchemaAttrs[XSAttributeChecker.ATTIDX_EFORMDEFAULT]).intValue() == SchemaSymbols.FORM_QUALIFIED;
        fBlockDefault =
            ((XInt)fSchemaAttrs[XSAttributeChecker.ATTIDX_BLOCKDEFAULT]).shortValue();
        fFinalDefault =
            ((XInt)fSchemaAttrs[XSAttributeChecker.ATTIDX_FINALDEFAULT]).shortValue();
        fTargetNamespace =
            (String)fSchemaAttrs[XSAttributeChecker.ATTIDX_TARGETNAMESPACE];
        if (fTargetNamespace != null)
            fTargetNamespace = symbolTable.addSymbol(fTargetNamespace);

        fNamespaceSupportRoot = new SchemaNamespaceSupport(fNamespaceSupport);

        //set namespace support
        fValidationContext.setNamespaceSupport(fNamespaceSupport);
        fValidationContext.setSymbolTable(symbolTable);
        // pass null as the schema document, so that the namespace
        // context is not popped.

        // don't return the attribute array yet!
        //attrChecker.returnAttrArray(schemaAttrs, null);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:44,代码来源:XSDocumentInfo.java


示例3: checkUniqueParticleAttribution

import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException; //导入依赖的package包/类
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
    // Unique Particle Attribution
    // store the conflict results between any two elements in fElemMap
    // 0: not compared; -1: no conflict; 1: conflict
    // initialize the conflict table (all 0 initially)
    byte conflictTable[][] = new byte[fElemMapSize][fElemMapSize];

    // for each state, check whether it has overlap transitions
    for (int i = 0; i < fTransTable.length && fTransTable[i] != null; i++) {
        for (int j = 0; j < fElemMapSize; j++) {
            for (int k = j+1; k < fElemMapSize; k++) {
                if (fTransTable[i][j] != -1 &&
                    fTransTable[i][k] != -1) {
                    if (conflictTable[j][k] == 0) {
                        if (XSConstraints.overlapUPA
                                (fElemMap[j], fElemMap[k],
                                        subGroupHandler)) {
                            if (fCountingStates != null) {
                                Occurence o = fCountingStates[i];
                                // If "i" is a counting state and exactly one of the transitions
                                // loops back to "i" then the two particles do not overlap if
                                // minOccurs == maxOccurs.
                                if (o != null &&
                                    fTransTable[i][j] == i ^ fTransTable[i][k] == i &&
                                    o.minOccurs == o.maxOccurs) {
                                    conflictTable[j][k] = (byte) -1;
                                    continue;
                                }
                            }
                            conflictTable[j][k] = (byte) 1;
                        }
                        else {
                            conflictTable[j][k] = (byte) -1;
                        }
                    }
                }
            }
        }
    }

    // report all errors
    for (int i = 0; i < fElemMapSize; i++) {
        for (int j = 0; j < fElemMapSize; j++) {
            if (conflictTable[i][j] == 1) {
                //errors.newError("cos-nonambig", new Object[]{fElemMap[i].toString(),
                //                                             fElemMap[j].toString()});
                // REVISIT: do we want to report all errors? or just one?
                throw new XMLSchemaException("cos-nonambig", new Object[]{fElemMap[i].toString(),
                                                                          fElemMap[j].toString()});
            }
        }
    }

    // if there is a other or list wildcard, we need to check this CM
    // again, if this grammar is cached.
    for (int i = 0; i < fElemMapSize; i++) {
        if (fElemMapType[i] == XSParticleDecl.PARTICLE_WILDCARD) {
            XSWildcardDecl wildcard = (XSWildcardDecl)fElemMap[i];
            if (wildcard.fType == XSWildcardDecl.NSCONSTRAINT_LIST ||
                wildcard.fType == XSWildcardDecl.NSCONSTRAINT_NOT) {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:74,代码来源:XSDFACM.java


示例4: checkUniqueParticleAttribution

import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException; //导入依赖的package包/类
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException;
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:XSCMValidator.java


示例5: checkUniqueParticleAttribution

import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaException; //导入依赖的package包/类
/**
 * check whether this content violates UPA constraint.
 *
 * @param subGroupHandler the substitution group handler
 * @return true if this content model contains other or list wildcard
 */
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException {
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:XSEmptyCM.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java XPathParseException类代码示例发布时间:2022-05-23
下一篇:
Java SqlExceptionHelper类代码示例发布时间: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