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


Java XSNamedMapImpl类代码示例

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


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

示例1: getComponents

import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl; //导入依赖的package包/类
/**
 * [schema components]: a list of top-level components, i.e. element
 * declarations, attribute declarations, etc.
 * @param objectType The type of the declaration, i.e.
 *   <code>ELEMENT_DECLARATION</code>. Note that
 *   <code>XSTypeDefinition.SIMPLE_TYPE</code> and
 *   <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
 *   <code>objectType</code> to retrieve only complex types or simple
 *   types, instead of all types.
 * @return  A list of top-level definition of the specified type in
 *   <code>objectType</code> or an empty <code>XSNamedMap</code> if no
 *   such definitions exist.
 */
public synchronized XSNamedMap getComponents(short objectType) {
    if (objectType <= 0 || objectType > MAX_COMP_IDX ||
        !GLOBAL_COMP[objectType]) {
        return XSNamedMapImpl.EMPTY_MAP;
    }

    if (fComponents == null)
        fComponents = new XSNamedMap[MAX_COMP_IDX+1];

    // get the hashtable for this type of components
    if (fComponents[objectType] == null) {
        SymbolHash table = null;
        switch (objectType) {
        case XSConstants.TYPE_DEFINITION:
        case XSTypeDefinition.COMPLEX_TYPE:
        case XSTypeDefinition.SIMPLE_TYPE:
            table = fGlobalTypeDecls;
            break;
        case XSConstants.ATTRIBUTE_DECLARATION:
            table = fGlobalAttrDecls;
            break;
        case XSConstants.ELEMENT_DECLARATION:
            table = fGlobalElemDecls;
            break;
        case XSConstants.ATTRIBUTE_GROUP:
            table = fGlobalAttrGrpDecls;
            break;
        case XSConstants.MODEL_GROUP_DEFINITION:
            table = fGlobalGroupDecls;
            break;
        case XSConstants.NOTATION_DECLARATION:
            table = fGlobalNotationDecls;
            break;
        }

        // for complex/simple types, create a special implementation,
        // which take specific types out of the hash table
        if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
            objectType == XSTypeDefinition.SIMPLE_TYPE) {
            fComponents[objectType] = new XSNamedMap4Types(fTargetNamespace, table, objectType);
        }
        else {
            fComponents[objectType] = new XSNamedMapImpl(fTargetNamespace, table);
        }
    }

    return fComponents[objectType];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:62,代码来源:SchemaGrammar.java

示例2: getComponents

import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl; //导入依赖的package包/类
/**
 * Returns a list of top-level components, i.e. element declarations,
 * attribute declarations, etc.
 * @param objectType The type of the declaration, i.e.
 *   <code>ELEMENT_DECLARATION</code>. Note that
 *   <code>XSTypeDefinition.SIMPLE_TYPE</code> and
 *   <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
 *   <code>objectType</code> to retrieve only complex types or simple
 *   types, instead of all types.
 * @return  A list of top-level definitions of the specified type in
 *   <code>objectType</code> or an empty <code>XSNamedMap</code> if no
 *   such definitions exist.
 */
public synchronized XSNamedMap getComponents(short objectType) {
    if (objectType <= 0 || objectType > MAX_COMP_IDX ||
        !GLOBAL_COMP[objectType]) {
        return XSNamedMapImpl.EMPTY_MAP;
    }

    SymbolHash[] tables = new SymbolHash[fGrammarCount];
    // get all hashtables from all namespaces for this type of components
    if (fGlobalComponents[objectType] == null) {
        for (int i = 0; i < fGrammarCount; i++) {
            switch (objectType) {
            case XSConstants.TYPE_DEFINITION:
            case XSTypeDefinition.COMPLEX_TYPE:
            case XSTypeDefinition.SIMPLE_TYPE:
                tables[i] = fGrammarList[i].fGlobalTypeDecls;
                break;
            case XSConstants.ATTRIBUTE_DECLARATION:
                tables[i] = fGrammarList[i].fGlobalAttrDecls;
                break;
            case XSConstants.ELEMENT_DECLARATION:
                tables[i] = fGrammarList[i].fGlobalElemDecls;
                break;
            case XSConstants.ATTRIBUTE_GROUP:
                tables[i] = fGrammarList[i].fGlobalAttrGrpDecls;
                break;
            case XSConstants.MODEL_GROUP_DEFINITION:
                tables[i] = fGrammarList[i].fGlobalGroupDecls;
                break;
            case XSConstants.NOTATION_DECLARATION:
                tables[i] = fGrammarList[i].fGlobalNotationDecls;
                break;
            }
        }
        // for complex/simple types, create a special implementation,
        // which take specific types out of the hash table
        if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
            objectType == XSTypeDefinition.SIMPLE_TYPE) {
            fGlobalComponents[objectType] = new XSNamedMap4Types(fNamespaces, tables, fGrammarCount, objectType);
        }
        else {
            fGlobalComponents[objectType] = new XSNamedMapImpl(fNamespaces, tables, fGrammarCount);
        }
    }

    return fGlobalComponents[objectType];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:60,代码来源:XSModelImpl.java

示例3: getComponentsByNamespace

import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl; //导入依赖的package包/类
/**
 * Convenience method. Returns a list of top-level component declarations
 * that are defined within the specified namespace, i.e. element
 * declarations, attribute declarations, etc.
 * @param objectType The type of the declaration, i.e.
 *   <code>ELEMENT_DECLARATION</code>.
 * @param namespace The namespace to which the declaration belongs or
 *   <code>null</code> (for components with no target namespace).
 * @return  A list of top-level definitions of the specified type in
 *   <code>objectType</code> and defined in the specified
 *   <code>namespace</code> or an empty <code>XSNamedMap</code>.
 */
public synchronized XSNamedMap getComponentsByNamespace(short objectType,
                                                        String namespace) {
    if (objectType <= 0 || objectType > MAX_COMP_IDX ||
        !GLOBAL_COMP[objectType]) {
        return XSNamedMapImpl.EMPTY_MAP;
    }

    // try to find the grammar
    int i = 0;
    if (namespace != null) {
        for (; i < fGrammarCount; ++i) {
            if (namespace.equals(fNamespaces[i])) {
                break;
            }
        }
    }
    else {
        for (; i < fGrammarCount; ++i) {
            if (fNamespaces[i] == null) {
                break;
            }
        }
    }
    if (i == fGrammarCount) {
        return XSNamedMapImpl.EMPTY_MAP;
    }

    // get the hashtable for this type of components
    if (fNSComponents[i][objectType] == null) {
        SymbolHash table = null;
        switch (objectType) {
        case XSConstants.TYPE_DEFINITION:
        case XSTypeDefinition.COMPLEX_TYPE:
        case XSTypeDefinition.SIMPLE_TYPE:
            table = fGrammarList[i].fGlobalTypeDecls;
            break;
        case XSConstants.ATTRIBUTE_DECLARATION:
            table = fGrammarList[i].fGlobalAttrDecls;
            break;
        case XSConstants.ELEMENT_DECLARATION:
            table = fGrammarList[i].fGlobalElemDecls;
            break;
        case XSConstants.ATTRIBUTE_GROUP:
            table = fGrammarList[i].fGlobalAttrGrpDecls;
            break;
        case XSConstants.MODEL_GROUP_DEFINITION:
            table = fGrammarList[i].fGlobalGroupDecls;
            break;
        case XSConstants.NOTATION_DECLARATION:
            table = fGrammarList[i].fGlobalNotationDecls;
            break;
        }

        // for complex/simple types, create a special implementation,
        // which take specific types out of the hash table
        if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
            objectType == XSTypeDefinition.SIMPLE_TYPE) {
            fNSComponents[i][objectType] = new XSNamedMap4Types(namespace, table, objectType);
        }
        else {
            fNSComponents[i][objectType] = new XSNamedMapImpl(namespace, table);
        }
    }

    return fNSComponents[i][objectType];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:79,代码来源:XSModelImpl.java

示例4: getIdentityConstraints

import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl; //导入依赖的package包/类
/**
 * {identity-constraint definitions} A set of constraint definitions.
 */
public XSNamedMap getIdentityConstraints() {
    return new XSNamedMapImpl(fIDConstraints, fIDCPos);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:XSElementDecl.java

示例5: getComponents

import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl; //导入依赖的package包/类
/**
 * [schema components]: a list of top-level components, i.e. element
 * declarations, attribute declarations, etc.
 * @param objectType The type of the declaration, i.e.
 *   <code>ELEMENT_DECLARATION</code>. Note that
 *   <code>XSTypeDefinition.SIMPLE_TYPE</code> and
 *   <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
 *   <code>objectType</code> to retrieve only complex types or simple
 *   types, instead of all types.
 * @return  A list of top-level definition of the specified type in
 *   <code>objectType</code> or an empty <code>XSNamedMap</code> if no
 *   such definitions exist.
 */
public synchronized XSNamedMap getComponents(short objectType) {
    if (objectType <= 0 || objectType > MAX_COMP_IDX ||
        !GLOBAL_COMP[objectType]) {
        return XSNamedMapImpl.EMPTY_MAP;
    }

    if (fComponents == null)
        fComponents = new XSNamedMap[MAX_COMP_IDX+1];

    // get the hashtable for this type of components
    if (fComponents[objectType] == null) {
        SymbolHash table = null;
        switch (objectType) {
        case XSConstants.TYPE_DEFINITION:
        case XSTypeDefinition.COMPLEX_TYPE:
        case XSTypeDefinition.SIMPLE_TYPE:
            table = fGlobalTypeDecls;
            break;
        case XSConstants.ATTRIBUTE_DECLARATION:
            table = fGlobalAttrDecls;
            break;
        case XSConstants.ELEMENT_DECLARATION:
            table = fGlobalElemDecls;
            break;
        case XSConstants.ATTRIBUTE_GROUP:
            table = fGlobalAttrGrpDecls;
            break;
        case XSConstants.MODEL_GROUP_DEFINITION:
            table = fGlobalGroupDecls;
            break;
        case XSConstants.NOTATION_DECLARATION:
            table = fGlobalNotationDecls;
            break;
        case XSConstants.IDENTITY_CONSTRAINT:
            table = this.fGlobalIDConstraintDecls;
            break;
        }

        // for complex/simple types, create a special implementation,
        // which take specific types out of the hash table
        if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
            objectType == XSTypeDefinition.SIMPLE_TYPE) {
            fComponents[objectType] = new XSNamedMap4Types(fTargetNamespace, table, objectType);
        }
        else {
            fComponents[objectType] = new XSNamedMapImpl(fTargetNamespace, table);
        }
    }

    return fComponents[objectType];
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:65,代码来源:SchemaGrammar.java

示例6: getComponents

import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl; //导入依赖的package包/类
/**
 * Returns a list of top-level components, i.e. element declarations,
 * attribute declarations, etc.
 * @param objectType The type of the declaration, i.e.
 *   <code>ELEMENT_DECLARATION</code>. Note that
 *   <code>XSTypeDefinition.SIMPLE_TYPE</code> and
 *   <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the
 *   <code>objectType</code> to retrieve only complex types or simple
 *   types, instead of all types.
 * @return  A list of top-level definitions of the specified type in
 *   <code>objectType</code> or an empty <code>XSNamedMap</code> if no
 *   such definitions exist.
 */
public synchronized XSNamedMap getComponents(short objectType) {
    if (objectType <= 0 || objectType > MAX_COMP_IDX ||
        !GLOBAL_COMP[objectType]) {
        return XSNamedMapImpl.EMPTY_MAP;
    }

    SymbolHash[] tables = new SymbolHash[fGrammarCount];
    // get all hashtables from all namespaces for this type of components
    if (fGlobalComponents[objectType] == null) {
        for (int i = 0; i < fGrammarCount; i++) {
            switch (objectType) {
            case XSConstants.TYPE_DEFINITION:
            case XSTypeDefinition.COMPLEX_TYPE:
            case XSTypeDefinition.SIMPLE_TYPE:
                tables[i] = fGrammarList[i].fGlobalTypeDecls;
                break;
            case XSConstants.ATTRIBUTE_DECLARATION:
                tables[i] = fGrammarList[i].fGlobalAttrDecls;
                break;
            case XSConstants.ELEMENT_DECLARATION:
                tables[i] = fGrammarList[i].fGlobalElemDecls;
                break;
            case XSConstants.ATTRIBUTE_GROUP:
                tables[i] = fGrammarList[i].fGlobalAttrGrpDecls;
                break;
            case XSConstants.MODEL_GROUP_DEFINITION:
                tables[i] = fGrammarList[i].fGlobalGroupDecls;
                break;
            case XSConstants.NOTATION_DECLARATION:
                tables[i] = fGrammarList[i].fGlobalNotationDecls;
                break;
            case XSConstants.IDENTITY_CONSTRAINT:
                tables[i] = fGrammarList[i].fGlobalIDConstraintDecls;
                break;
            }
        }
        // for complex/simple types, create a special implementation,
        // which take specific types out of the hash table
        if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
            objectType == XSTypeDefinition.SIMPLE_TYPE) {
            fGlobalComponents[objectType] = new XSNamedMap4Types(fNamespaces, tables, fGrammarCount, objectType);
        }
        else {
            fGlobalComponents[objectType] = new XSNamedMapImpl(fNamespaces, tables, fGrammarCount);
        }
    }

    return fGlobalComponents[objectType];
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:63,代码来源:XSModelImpl.java

示例7: getComponentsByNamespace

import com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl; //导入依赖的package包/类
/**
 * Convenience method. Returns a list of top-level component declarations
 * that are defined within the specified namespace, i.e. element
 * declarations, attribute declarations, etc.
 * @param objectType The type of the declaration, i.e.
 *   <code>ELEMENT_DECLARATION</code>.
 * @param namespace The namespace to which the declaration belongs or
 *   <code>null</code> (for components with no target namespace).
 * @return  A list of top-level definitions of the specified type in
 *   <code>objectType</code> and defined in the specified
 *   <code>namespace</code> or an empty <code>XSNamedMap</code>.
 */
public synchronized XSNamedMap getComponentsByNamespace(short objectType,
                                                        String namespace) {
    if (objectType <= 0 || objectType > MAX_COMP_IDX ||
        !GLOBAL_COMP[objectType]) {
        return XSNamedMapImpl.EMPTY_MAP;
    }

    // try to find the grammar
    int i = 0;
    if (namespace != null) {
        for (; i < fGrammarCount; ++i) {
            if (namespace.equals(fNamespaces[i])) {
                break;
            }
        }
    }
    else {
        for (; i < fGrammarCount; ++i) {
            if (fNamespaces[i] == null) {
                break;
            }
        }
    }
    if (i == fGrammarCount) {
        return XSNamedMapImpl.EMPTY_MAP;
    }

    // get the hashtable for this type of components
    if (fNSComponents[i][objectType] == null) {
        SymbolHash table = null;
        switch (objectType) {
        case XSConstants.TYPE_DEFINITION:
        case XSTypeDefinition.COMPLEX_TYPE:
        case XSTypeDefinition.SIMPLE_TYPE:
            table = fGrammarList[i].fGlobalTypeDecls;
            break;
        case XSConstants.ATTRIBUTE_DECLARATION:
            table = fGrammarList[i].fGlobalAttrDecls;
            break;
        case XSConstants.ELEMENT_DECLARATION:
            table = fGrammarList[i].fGlobalElemDecls;
            break;
        case XSConstants.ATTRIBUTE_GROUP:
            table = fGrammarList[i].fGlobalAttrGrpDecls;
            break;
        case XSConstants.MODEL_GROUP_DEFINITION:
            table = fGrammarList[i].fGlobalGroupDecls;
            break;
        case XSConstants.NOTATION_DECLARATION:
            table = fGrammarList[i].fGlobalNotationDecls;
            break;
        case XSConstants.IDENTITY_CONSTRAINT:
            table = fGrammarList[i].fGlobalIDConstraintDecls;
            break;
        }

        // for complex/simple types, create a special implementation,
        // which take specific types out of the hash table
        if (objectType == XSTypeDefinition.COMPLEX_TYPE ||
            objectType == XSTypeDefinition.SIMPLE_TYPE) {
            fNSComponents[i][objectType] = new XSNamedMap4Types(namespace, table, objectType);
        }
        else {
            fNSComponents[i][objectType] = new XSNamedMapImpl(namespace, table);
        }
    }

    return fNSComponents[i][objectType];
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:82,代码来源:XSModelImpl.java


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