當前位置: 首頁>>代碼示例>>Java>>正文


Java XSNamedMap.item方法代碼示例

本文整理匯總了Java中mf.org.apache.xerces.xs.XSNamedMap.item方法的典型用法代碼示例。如果您正苦於以下問題:Java XSNamedMap.item方法的具體用法?Java XSNamedMap.item怎麽用?Java XSNamedMap.item使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mf.org.apache.xerces.xs.XSNamedMap的用法示例。


在下文中一共展示了XSNamedMap.item方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildSubGroups_Org

import mf.org.apache.xerces.xs.XSNamedMap; //導入方法依賴的package包/類
private SymbolHash buildSubGroups_Org() {
    SubstitutionGroupHandler sgHandler = new SubstitutionGroupHandler(null);
    for (int i = 0 ; i < fGrammarCount; i++) {
        sgHandler.addSubstitutionGroup(fGrammarList[i].getSubstitutionGroups());
    }

    final XSNamedMap elements = getComponents(XSConstants.ELEMENT_DECLARATION);
    final int len = elements.getLength();
    final SymbolHash subGroupMap = new SymbolHash(len*2);
    XSElementDecl head;
    XSElementDeclaration[] subGroup;
    for (int i = 0; i < len; i++) {
        head = (XSElementDecl)elements.item(i);
        subGroup = sgHandler.getSubstitutionGroup(head);
        subGroupMap.put(head, subGroup.length > 0 ? 
                new XSObjectListImpl(subGroup, subGroup.length) : XSObjectListImpl.EMPTY_LIST);
    }
    return subGroupMap;
}
 
開發者ID:MaTriXy,項目名稱:xerces-for-android,代碼行數:20,代碼來源:XSModelImpl.java

示例2: addGlobalElementDecls

import mf.org.apache.xerces.xs.XSNamedMap; //導入方法依賴的package包/類
private void addGlobalElementDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.ELEMENT_DECLARATION);
    int len = components.getLength();
    XSElementDecl srcDecl, dstDecl;

    // add global components
    for (int i=0; i<len; i++) {
        srcDecl = (XSElementDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalElementDecl(srcDecl.getName()); 
        if (dstDecl == null) {
            dstGrammar.addGlobalElementDecl(srcDecl);
        }
        else if (dstDecl != srcDecl){
            // TODO: if not tolerating duplicate, generate an error message
        }
    }

    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.ELEMENT_DECLARATION);
    len = componentsExt.getLength();

    for (int i=0; i<len; i+= 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());

        srcDecl = (XSElementDecl)componentsExt.item(i+1);
        dstDecl = dstGrammar.getGlobalElementDecl(name, location); 
        if ( dstDecl == null) {
            dstGrammar.addGlobalElementDecl(srcDecl, location);
        }
        else if (dstDecl != srcDecl){
            // TODO: if not tolerating duplicate, generate an error message
        }
    }
}
 
開發者ID:MaTriXy,項目名稱:xerces-for-android,代碼行數:38,代碼來源:XSDHandler.java

示例3: addGlobalAttributeDecls

import mf.org.apache.xerces.xs.XSNamedMap; //導入方法依賴的package包/類
private void addGlobalAttributeDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
    int len = components.getLength();
    XSAttributeDecl srcDecl, dstDecl;

    // add global components
    for (int i=0; i<len; i++) {
        srcDecl = (XSAttributeDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalAttributeDecl(srcDecl.getName()); 
        if (dstDecl == null) {
            dstGrammar.addGlobalAttributeDecl(srcDecl);
        }
        else if (dstDecl != srcDecl && !fTolerateDuplicates) {
            reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
        }
    }

    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.ATTRIBUTE_DECLARATION);
    len = componentsExt.getLength();

    for (int i=0; i<len; i+= 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());
        
        srcDecl = (XSAttributeDecl)componentsExt.item(i+1);
        dstDecl = dstGrammar.getGlobalAttributeDecl(name, location); 
        if (dstDecl == null) {
            dstGrammar.addGlobalAttributeDecl(srcDecl, location);
        }
        // REVISIT - do we report an error?
        else if (dstDecl != srcDecl) {
        }
    }
}
 
開發者ID:MaTriXy,項目名稱:xerces-for-android,代碼行數:38,代碼來源:XSDHandler.java

示例4: addGlobalAttributeGroupDecls

import mf.org.apache.xerces.xs.XSNamedMap; //導入方法依賴的package包/類
private void addGlobalAttributeGroupDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.ATTRIBUTE_GROUP);
    int len = components.getLength();
    XSAttributeGroupDecl srcDecl, dstDecl;

    // add global components
    for (int i=0; i<len; i++) {
        srcDecl = (XSAttributeGroupDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalAttributeGroupDecl(srcDecl.getName());
        if (dstDecl == null) {
            dstGrammar.addGlobalAttributeGroupDecl(srcDecl);
        }
        else if (dstDecl != srcDecl && !fTolerateDuplicates) {
            reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
        }
    }

    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.ATTRIBUTE_GROUP);
    len = componentsExt.getLength();

    for (int i=0; i<len; i+= 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());
        
        srcDecl = (XSAttributeGroupDecl)componentsExt.item(i+1);
        dstDecl = dstGrammar.getGlobalAttributeGroupDecl(name, location);
        if (dstDecl == null) {
            dstGrammar.addGlobalAttributeGroupDecl(srcDecl, location);
        }
        // REVISIT - do we report an error?
        else if (dstDecl != srcDecl) {
        }
    }
}
 
開發者ID:MaTriXy,項目名稱:xerces-for-android,代碼行數:38,代碼來源:XSDHandler.java

示例5: addGlobalNotationDecls

import mf.org.apache.xerces.xs.XSNamedMap; //導入方法依賴的package包/類
private void addGlobalNotationDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.NOTATION_DECLARATION);
    int len = components.getLength();
    XSNotationDecl srcDecl, dstDecl;

    // add global components
    for (int i=0; i<len; i++) {
        srcDecl = (XSNotationDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalNotationDecl(srcDecl.getName());
        if (dstDecl == null) {
            dstGrammar.addGlobalNotationDecl(srcDecl);
        }
        else if (dstDecl != srcDecl && !fTolerateDuplicates) {
            reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
        }
    }

    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.NOTATION_DECLARATION);
    len = componentsExt.getLength();

    for (int i=0; i<len; i+= 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());

        srcDecl = (XSNotationDecl)componentsExt.item(i+1);
        dstDecl = dstGrammar.getGlobalNotationDecl(name, location);
        if (dstDecl == null) {
            dstGrammar.addGlobalNotationDecl(srcDecl, location);
        }
        // REVISIT - do we report an error?
        else if (dstDecl != srcDecl) {
        }
    }
}
 
開發者ID:MaTriXy,項目名稱:xerces-for-android,代碼行數:38,代碼來源:XSDHandler.java

示例6: addGlobalGroupDecls

import mf.org.apache.xerces.xs.XSNamedMap; //導入方法依賴的package包/類
private void addGlobalGroupDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.MODEL_GROUP_DEFINITION);
    int len = components.getLength();
    XSGroupDecl srcDecl, dstDecl;

    // add global components
    for (int i=0; i<len; i++) {
        srcDecl = (XSGroupDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalGroupDecl(srcDecl.getName());
        if (dstDecl == null) {
            dstGrammar.addGlobalGroupDecl(srcDecl);
        }
        else if (srcDecl != dstDecl && !fTolerateDuplicates) {
            reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
        }
    }

    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.MODEL_GROUP_DEFINITION);
    len = componentsExt.getLength();

    for (int i=0; i<len; i+= 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());

        srcDecl = (XSGroupDecl)componentsExt.item(i+1);
        dstDecl = dstGrammar.getGlobalGroupDecl(name, location);
        if (dstDecl == null) {
            dstGrammar.addGlobalGroupDecl(srcDecl, location);
        }
        // REVIST - do we report an error?
        else if (dstDecl != srcDecl) {
        }
    }
}
 
開發者ID:MaTriXy,項目名稱:xerces-for-android,代碼行數:38,代碼來源:XSDHandler.java

示例7: map

import mf.org.apache.xerces.xs.XSNamedMap; //導入方法依賴的package包/類
private static SchemaModel map(XSModel xsModel, int maxRecusiveDepth)
{
    // get namespaces
    StringList namespaces = xsModel.getNamespaces();
    List<String> namesspaceList = new ArrayList<String>();
    for (int i = 0; i < namespaces.getLength(); i++)
    {
        namesspaceList.add(namespaces.item(i));
    }

    // get top-level complex elements
    XSNamedMap elements = xsModel.getComponents(XSConstants.ELEMENT_DECLARATION);
    List<SchemaElementComplex> components = new ArrayList<SchemaElementComplex>();

    for (int i = 0; i < elements.getLength(); i++)
    {
        XSObject object = elements.item(i);
        if (!(object instanceof XSElementDeclaration))
        {
            continue;
        }

        XSElementDeclaration decl = (XSElementDeclaration) elements.item(i);
        if (!isComplexTypeCategory(decl.getTypeDefinition().getTypeCategory()))
        {
            continue;
        }            

        XSComplexTypeDefinition complexActualElement = (XSComplexTypeDefinition) decl.getTypeDefinition();
        String name = object.getName();
        String namespace = object.getNamespace();
        Stack<NamespaceNamePair> nameNamespaceStack = new Stack<NamespaceNamePair>();
        NamespaceNamePair nameNamespace = new NamespaceNamePair(namespace, name);
        nameNamespaceStack.add(nameNamespace);

        if (log.isDebugEnabled())
        {
            log.debug("Processing component " + namespace + " " + name);
        }

        SchemaElementComplex complexElement = process(name, namespace, complexActualElement, false, nameNamespaceStack, maxRecusiveDepth);

        if (log.isDebugEnabled())
        {
            log.debug("Adding component " + namespace + " " + name);
        }
        components.add(complexElement);
    }

    return new SchemaModel(components, namesspaceList);
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:52,代碼來源:XSDSchemaMapper.java


注:本文中的mf.org.apache.xerces.xs.XSNamedMap.item方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。