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


Java XSConstants.SCOPE_GLOBAL属性代码示例

本文整理汇总了Java中org.apache.xerces.xs.XSConstants.SCOPE_GLOBAL属性的典型用法代码示例。如果您正苦于以下问题:Java XSConstants.SCOPE_GLOBAL属性的具体用法?Java XSConstants.SCOPE_GLOBAL怎么用?Java XSConstants.SCOPE_GLOBAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.xerces.xs.XSConstants的用法示例。


在下文中一共展示了XSConstants.SCOPE_GLOBAL属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: analyzeElement

private void analyzeElement(IXSDNode currentNode, XSParticleDecl fatherParticle, XSElementDecl elementDeclaration) {
    if (logger.isDebugEnabled()) logger.debug("analyzeElement: " + elementDeclaration.getName());
    String elementName = elementDeclaration.getName();
    IXSDNode element = null;
    if (elementDeclaration.getScope() == XSConstants.SCOPE_GLOBAL) {
        if (logger.isDebugEnabled()) logger.debug(elementName + " has GLOBAL SCOPE");
        element = globalElements.get(elementName);
        if (element == null) {
            element = createNewElement(elementDeclaration);
            globalElements.put(elementName, element);
            analyzeType(element, fatherParticle, elementDeclaration);
        } else {
            element.setNested(true);
            element = element.clone();
            setCardinality(element, fatherParticle);
        }
    } else {
        element = createNewElement(elementDeclaration);
        analyzeType(element, fatherParticle, elementDeclaration);
    }
    if (currentNode != null) {
        currentNode.addChild(element);
    }
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:24,代码来源:GenerateXSDNodeTree.java

示例2: getMatchingElemDecl

public XSElementDecl getMatchingElemDecl(QName element, XSElementDecl exemplar) {
    if (element.localpart == exemplar.fName &&
        element.uri == exemplar.fTargetNamespace) {
        return exemplar;
    }

    // if the exemplar is not a global element decl, then it's not possible
    // to be substituted by another element.
    if (exemplar.fScope != XSConstants.SCOPE_GLOBAL) {
        return null;
    }

    // if the decl blocks substitution, return false
    if ((exemplar.fBlock & XSConstants.DERIVATION_SUBSTITUTION) != 0) {
        return null;
    }

    // get the decl for the element
    XSElementDecl eDecl = fXSElementDeclHelper.getGlobalElementDecl(element);
    if (eDecl == null) {
        return null;
    }

    // and check by using substitutionGroup information
    if (substitutionGroupOK(eDecl, exemplar, exemplar.fBlock)) {
        return eDecl;
    }

    return null;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:30,代码来源:SubstitutionGroupHandler.java

示例3: addRelatedElement

private void addRelatedElement(XSElementDeclaration decl, Vector componentList, String namespace, Hashtable dependencies) {
    if (decl.getScope() == XSConstants.SCOPE_GLOBAL) {
        if (!componentList.contains(decl)) {
            Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
            addNamespaceDependency(namespace, decl.getNamespace(), importedNamespaces);
            componentList.add(decl);
        }
    }
    else {
        expandRelatedElementComponents(decl, componentList, namespace, dependencies);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:12,代码来源:XSDHandler.java

示例4: addRelatedAttribute

private void addRelatedAttribute(XSAttributeDeclaration decl, Vector componentList, String namespace, Hashtable dependencies) {
    if (decl.getScope() == XSConstants.SCOPE_GLOBAL) {
        if (!componentList.contains(decl)) {
            Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
            addNamespaceDependency(namespace, decl.getNamespace(), importedNamespaces);
            componentList.add(decl);
        }
    }
    else {
        expandRelatedAttributeComponents(decl, componentList, namespace, dependencies);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:12,代码来源:XSDHandler.java

示例5: checkElementDeclsConsistent

public static void checkElementDeclsConsistent(XSComplexTypeDecl type,
        XSParticleDecl particle,
        SymbolHash elemDeclHash,
        SubstitutionGroupHandler sgHandler)
    throws XMLSchemaException {

    // check for elements in the tree with the same name and namespace

    int pType = particle.fType;

    if (pType == XSParticleDecl.PARTICLE_WILDCARD)
        return;

    if (pType == XSParticleDecl.PARTICLE_ELEMENT) {
        XSElementDecl elem = (XSElementDecl)(particle.fValue);
        findElemInTable(type, elem, elemDeclHash);

        if (elem.fScope == XSConstants.SCOPE_GLOBAL) {
            // Check for subsitution groups.
            XSElementDecl[] subGroup = sgHandler.getSubstitutionGroup(elem);
            for (int i = 0; i < subGroup.length; i++) {
                findElemInTable(type, subGroup[i], elemDeclHash);
            }
        }
        return;
    }

    XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
    for (int i = 0; i < group.fParticleCount; i++)
        checkElementDeclsConsistent(type, group.fParticles[i], elemDeclHash, sgHandler);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:31,代码来源:XSConstraints.java

示例6: processPSVIAttributeDeclarationOrRef

private void processPSVIAttributeDeclarationOrRef(XSAttributeDeclaration att) {
    if (att == null)
        return;
    // for global attributes, and attributes that have already been printed,
    // we always want to print references
    if (att.getScope() == XSConstants.SCOPE_GLOBAL
        || fDefined.contains(this.getID(att))) {
        processPSVIAttributeDeclarationRef(att);
    }
    else {
        processPSVIAttributeDeclaration(att);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:13,代码来源:PSVIWriter.java

示例7: processPSVIElementDeclarationOrRef

private void processPSVIElementDeclarationOrRef(XSElementDeclaration elem) {
    if (elem == null)
        return;
    // for global attributes, and attributes that have already been printed,
    // we always want to print references
    if (elem.getScope() == XSConstants.SCOPE_GLOBAL
        || fDefined.contains(this.getID(elem))) {
        processPSVIElementDeclarationRef(elem);
    }
    else {
        processPSVIElementDeclaration(elem);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:13,代码来源:PSVIWriter.java

示例8: processPSVIScope

private void processPSVIScope(
    String enclose,
    XSComplexTypeDefinition enclosingCTD,
    short scope) {
    if (scope == XSConstants.SCOPE_ABSENT || scope == XSConstants.SCOPE_GLOBAL) {
        sendElementEvent(enclose, this.translateScope(scope));
    } else {  // XSConstants.SCOPE_LOCAL
        processPSVITypeDefinitionRef(enclose, enclosingCTD);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:10,代码来源:PSVIWriter.java

示例9: translateScope

private String translateScope(short scope) {
    switch (scope) {
        case XSConstants.SCOPE_ABSENT :
            return null;
        case XSConstants.SCOPE_GLOBAL :
            return "global";
        case XSConstants.SCOPE_LOCAL :
            return "local";
        default :
            return "unknown";
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:12,代码来源:PSVIWriter.java


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