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


Java ClassNotFound类代码示例

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


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

示例1: initParents

import sun.tools.java.ClassNotFound; //导入依赖的package包/类
protected boolean initParents(ContextStack stack) {

        stack.setNewContextCode(ContextStack.EXTENDS);
        BatchEnvironment env = stack.getEnv();

        // Init parent...

        boolean result = true;

        try {
            ClassDeclaration parentDecl = getClassDefinition().getSuperClass(env);
            if (parentDecl != null) {
                ClassDefinition parentDef = parentDecl.getClassDefinition(env);
                parent = (ClassType) makeType(parentDef.getType(),parentDef,stack);
                if (parent == null) {
                    result = false;
                }
            }
        } catch (ClassNotFound e) {
            classNotFound(stack,e);
            throw new CompilerError("ClassType constructor");
        }

        return result;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:ClassType.java

示例2: mergeWith

import sun.tools.java.ClassNotFound; //导入依赖的package包/类
/**
 * Return a new Method object that is a legal combination of
 * this method object and another one.
 *
 * This requires determining the exceptions declared by the
 * combined method, which must be only those exceptions
 * that may thrown by both of the old methods.
 */
public Method mergeWith(Method other) {
    if (!equals(other)) {
        env.error(0, "attempt to merge method failed:", getName(),
                  enclosing.getClassDefinition().getName());
    }

    Vector legalExceptions = new Vector();
    try {
        collectCompatibleExceptions(
              other.exceptions, exceptions, legalExceptions);
        collectCompatibleExceptions(
              exceptions, other.exceptions, legalExceptions);
    } catch (ClassNotFound e) {
        env.error(0, "class.not.found", e.name,
                  enclosing.getClassDefinition().getName());
        return null;
    }

    Method merged = (Method) clone();
    merged.exceptions = new ValueType[legalExceptions.size()];
    legalExceptions.copyInto(merged.exceptions);
    merged.implExceptions = merged.exceptions;

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

示例3: collectCompatibleExceptions

import sun.tools.java.ClassNotFound; //导入依赖的package包/类
/**
 * Add to the supplied list all exceptions in the "from" array
 * that are subclasses of an exception in the "with" array.
 */
private void collectCompatibleExceptions(
        ValueType[] from, ValueType[] with, Vector list)
        throws ClassNotFound {

    for (int i = 0; i < from.length; i++) {
        ClassDefinition exceptionDef = from[i].getClassDefinition();
        if (!list.contains(from[i])) {
            for (int j = 0; j < with.length; j++) {
                if (exceptionDef.subClassOf(
                        enclosing.getEnv(),
                        with[j].getClassDeclaration())) {
                    list.addElement(from[i]);
                    break;
                }
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:CompoundType.java

示例4: isSpecial

import sun.tools.java.ClassNotFound; //导入依赖的package包/类
private static boolean isSpecial(sun.tools.java.Type type,
                                 ClassDefinition theClass,
                                 ContextStack stack) {
    if (type.isType(TC_CLASS)) {
        Identifier id = type.getClassName();

        if (id.equals(idRemote)) return true;
        if (id == idJavaIoSerializable) return true;
        if (id == idJavaIoExternalizable) return true;
        if (id == idCorbaObject) return true;
        if (id == idIDLEntity) return true;
        BatchEnvironment env = stack.getEnv();
        try {
            if (env.defCorbaObject.implementedBy(env,theClass.getClassDeclaration())) return true;
        } catch (ClassNotFound e) {
            classNotFound(stack,e);
        }
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:SpecialInterfaceType.java

示例5: couldBeRemote

import sun.tools.java.ClassNotFound; //导入依赖的package包/类
private static boolean couldBeRemote (boolean quiet, ContextStack stack,
                                      ClassDefinition classDef) {

    boolean result = false;
    BatchEnvironment env = stack.getEnv();

    try {
        if (!classDef.isInterface()) {
            failedConstraint(16,quiet,stack,classDef.getName());
        } else {
            result = env.defRemote.implementedBy(env,classDef.getClassDeclaration());
            if (!result) failedConstraint(1,quiet,stack,classDef.getName());
        }
    } catch (ClassNotFound e) {
        classNotFound(stack,e);
    }

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

示例6: couldBeAbstract

import sun.tools.java.ClassNotFound; //导入依赖的package包/类
private static boolean couldBeAbstract(ContextStack stack, ClassDefinition classDef,
                                       boolean quiet) {

    // Return true if interface and not remote...

    boolean result = false;

    if (classDef.isInterface()) {
        BatchEnvironment env = stack.getEnv();

        try {
            result = ! env.defRemote.implementedBy(env, classDef.getClassDeclaration());
            if (!result) failedConstraint(15,quiet,stack,classDef.getName());
        } catch (ClassNotFound e) {
            classNotFound(stack,e);
        }
    } else {
        failedConstraint(14,quiet,stack,classDef.getName());
    }


    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:AbstractType.java

示例7: couldBeImplementation

import sun.tools.java.ClassNotFound; //导入依赖的package包/类
private static boolean couldBeImplementation(boolean quiet, ContextStack stack,
                                             ClassDefinition classDef) {
    boolean result = false;
    BatchEnvironment env = stack.getEnv();

    try {
        if (!classDef.isClass()) {
            failedConstraint(17,quiet,stack,classDef.getName());
        } else {
            result = env.defRemote.implementedBy(env, classDef.getClassDeclaration());
            if (!result) failedConstraint(8,quiet,stack,classDef.getName());
        }
    } catch (ClassNotFound e) {
        classNotFound(stack,e);
    }

    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:ImplementationType.java

示例8: collectCompatibleExceptions

import sun.tools.java.ClassNotFound; //导入依赖的package包/类
/**
 * Add to the supplied list all exceptions in the "from" array
 * that are subclasses of an exception in the "with" array.
 */
private void collectCompatibleExceptions(ClassDeclaration[] from,
                                         ClassDeclaration[] with,
                                         Vector<ClassDeclaration> list)
    throws ClassNotFound
{
    for (int i = 0; i < from.length; i++) {
        ClassDefinition exceptionDef = from[i].getClassDefinition(env);
        if (!list.contains(from[i])) {
            for (int j = 0; j < with.length; j++) {
                if (exceptionDef.subClassOf(env, with[j])) {
                    list.addElement(from[i]);
                    break;
                }
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:RemoteClass.java


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