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


Java XSParticleDecl类代码示例

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


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

示例1: removeParticle

import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl; //导入依赖的package包/类
private boolean removeParticle(XSModelGroupImpl group, XSParticleDecl particle) {
    XSParticleDecl member;
    for (int i = 0; i < group.fParticleCount; i++) {
        member = group.fParticles[i];
        if (member == particle) {
            for (int j = i; j < group.fParticleCount-1; j++)
                group.fParticles[j] = group.fParticles[j+1];
            group.fParticleCount--;
            return true;
        }
        if (member.fType == XSParticleDecl.PARTICLE_MODELGROUP) {
            if (removeParticle((XSModelGroupImpl)member.fValue, particle))
                return true;
        }
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XSDHandler.java

示例2: getErrorContent

import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl; //导入依赖的package包/类
private static XSParticleDecl getErrorContent() {
    if (fErrorContent == null) {
        XSParticleDecl particle = new XSParticleDecl();
        particle.fType = XSParticleDecl.PARTICLE_WILDCARD;
        particle.fValue = getErrorWildcard();
        particle.fMinOccurs = 0;
        particle.fMaxOccurs = SchemaSymbols.OCCURRENCE_UNBOUNDED;
        XSModelGroupImpl group = new XSModelGroupImpl();
        group.fCompositor = XSModelGroupImpl.MODELGROUP_SEQUENCE;
        group.fParticleCount = 1;
        group.fParticles = new XSParticleDecl[1];
        group.fParticles[0] = particle;
        XSParticleDecl errorContent = new XSParticleDecl();
        errorContent.fType = XSParticleDecl.PARTICLE_MODELGROUP;
        errorContent.fValue = group;
        fErrorContent = errorContent;
    }
    return fErrorContent;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:XSDComplexTypeTraverser.java

示例3: contentRestore

import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl; //导入依赖的package包/类
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XSDComplexTypeTraverser.java

示例4: findMatchingDecl

import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl; //导入依赖的package包/类
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

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

示例5: createAllCM

import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl; //导入依赖的package包/类
XSCMValidator createAllCM(XSParticleDecl particle) {
    if (particle.fMaxOccurs == 0)
        return null;

    // get the model group, and add all children of it to the content model
    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    // create an all content model. the parameter indicates whether
    // the <all> itself is optional
    XSAllCM allContent = new XSAllCM(particle.fMinOccurs == 0, group.fParticleCount);
    for (int i = 0; i < group.fParticleCount; i++) {
        // add the element decl to the all content model
        allContent.addElement((XSElementDecl)group.fParticles[i].fValue,
        group.fParticles[i].fMinOccurs == 0);
    }
    return allContent;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:CMBuilder.java

示例6: copyNode

import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl; //导入依赖的package包/类
private CMNode copyNode(CMNode node) {
    int type = node.type();
    // for choice or sequence, copy the two subtrees, and combine them
    if (type == XSModelGroupImpl.MODELGROUP_CHOICE ||
        type == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
        XSCMBinOp bin = (XSCMBinOp)node;
        node = fNodeFactory.getCMBinOpNode(type, copyNode(bin.getLeft()),
                             copyNode(bin.getRight()));
    }
    // for ?+*, copy the subtree, and put it in a new ?+* node
    else if (type == XSParticleDecl.PARTICLE_ZERO_OR_MORE ||
             type == XSParticleDecl.PARTICLE_ONE_OR_MORE ||
             type == XSParticleDecl.PARTICLE_ZERO_OR_ONE) {
        XSCMUniOp uni = (XSCMUniOp)node;
        node = fNodeFactory.getCMUniOpNode(type, copyNode(uni.getChild()));
    }
    // for element/wildcard (leaf), make a new leaf node,
    // with a distinct position
    else if (type == XSParticleDecl.PARTICLE_ELEMENT ||
             type == XSParticleDecl.PARTICLE_WILDCARD) {
        XSCMLeaf leaf = (XSCMLeaf)node;
        node = fNodeFactory.getCMLeafNode(leaf.type(), leaf.getLeaf(), leaf.getParticleId(), fLeafCount++);
    }

    return node;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:CMBuilder.java

示例7: useRepeatingLeafNodes

import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl; //导入依赖的package包/类
private boolean useRepeatingLeafNodes(XSParticleDecl particle) {
    int maxOccurs = particle.fMaxOccurs;
    int minOccurs = particle.fMinOccurs;
    short type = particle.fType;

    if (type == XSParticleDecl.PARTICLE_MODELGROUP) {
        XSModelGroupImpl group = (XSModelGroupImpl) particle.fValue;
        if (minOccurs != 1 || maxOccurs != 1) {
            if (group.fParticleCount == 1) {
                XSParticleDecl particle2 = (XSParticleDecl) group.fParticles[0];
                short type2 = particle2.fType;
                return ((type2 == XSParticleDecl.PARTICLE_ELEMENT ||
                        type2 == XSParticleDecl.PARTICLE_WILDCARD) &&
                        particle2.fMinOccurs == 1 &&
                        particle2.fMaxOccurs == 1);
            }
            return (group.fParticleCount == 0);
        }
        for (int i = 0; i < group.fParticleCount; ++i) {
            if (!useRepeatingLeafNodes(group.fParticles[i])) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:CMBuilder.java

示例8: contentRestore

import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl; //导入依赖的package包/类
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]);
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:XSDComplexTypeTraverser.java


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