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


Java ClassDefinition.getInterfaces方法代码示例

本文整理汇总了Java中sun.tools.java.ClassDefinition.getInterfaces方法的典型用法代码示例。如果您正苦于以下问题:Java ClassDefinition.getInterfaces方法的具体用法?Java ClassDefinition.getInterfaces怎么用?Java ClassDefinition.getInterfaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.tools.java.ClassDefinition的用法示例。


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

示例1: inheritsFrom

import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
protected boolean inheritsFrom(ClassDefinition def, ClassDefinition otherDef) {
    if (def == otherDef)
        return true;

    ClassDefinition superDef;
    if (def.getSuperClass() != null) {
        superDef = def.getSuperClass().getClassDefinition();
        if (inheritsFrom(superDef, otherDef))
            return true;
    }

    ClassDeclaration[] interfaces = def.getInterfaces();
    for (int i=0; i<interfaces.length; i++) {
        superDef = interfaces[i].getClassDefinition();
        if (inheritsFrom(superDef, otherDef))
            return true;
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:CompoundType.java

示例2: addRemoteInterfaces

import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
protected Vector addRemoteInterfaces (Vector list,
                                      boolean allowNonConforming,
                                      ContextStack stack) throws ClassNotFound {

    // Add all the interfaces of current...

    ClassDefinition theInterface = getClassDefinition();
    ClassDeclaration[] interfaces = theInterface.getInterfaces();

    stack.setNewContextCode(ContextStack.IMPLEMENTS);

    for (int i = 0; i < interfaces.length; i++) {

        ClassDefinition def = interfaces[i].getClassDefinition(env);

        // Is it a SpecialInterfaceType...

        InterfaceType it = SpecialInterfaceType.forSpecial(def,stack);;

        if (it == null) {

            // No, is it Remote?

            if (env.defRemote.implementedBy(env, interfaces[i])) {

                // Yes, so it must be a RemoteType.

                it = RemoteType.forRemote(def,stack,false);

            } else {

                // Then try Abstract...

                it = AbstractType.forAbstract(def,stack,true);

                if (it == null && allowNonConforming) {

                    // Must be non-conforming...

                    it = NCInterfaceType.forNCInterface(def,stack);
                }
            }
        }

        if (it != null) {
            list.addElement(it);
        } else {
            return null;
        }
    }

    return list;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:54,代码来源:CompoundType.java

示例3: addNonRemoteInterfaces

import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
protected Vector addNonRemoteInterfaces (Vector list,
                                         ContextStack stack) throws ClassNotFound {

    // Add all the interfaces of current...

    ClassDefinition theInterface = getClassDefinition();
    ClassDeclaration[] interfaces = theInterface.getInterfaces();

    stack.setNewContextCode(ContextStack.IMPLEMENTS);

    for (int i = 0; i < interfaces.length; i++) {

        ClassDefinition def = interfaces[i].getClassDefinition(env);

        // First try SpecialInterfaceType...

        InterfaceType it = SpecialInterfaceType.forSpecial(def,stack);

        if (it == null) {

            // Then try AbstractType...

            it = AbstractType.forAbstract(def,stack,true);

            if (it == null) {

                // Then try NCInterfaceType...

                it = NCInterfaceType.forNCInterface(def,stack);
            }
        }

        if (it != null) {
            list.addElement(it);
        } else {
            return null;
        }
    }

    return list;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:42,代码来源:CompoundType.java


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