Java Code Examples for sun.tools.java.ClassDefinition#isInterface()

The following examples show how to use sun.tools.java.ClassDefinition#isInterface() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RemoteType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 2
Source File: AbstractType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 3
Source File: RemoteType.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 4
Source File: AbstractType.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 5
Source File: RemoteType.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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;
}
 
Example 6
Source File: InterfaceType.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a InterfaceType instance for the given class.  The resulting
 * object is not yet completely initialized. Subclasses must call
 * initialize(directInterfaces,directInterfaces,directConstants);
 */
protected InterfaceType(ContextStack stack,
                        ClassDefinition classDef,
                        int typeCode) {
    super(stack,classDef,typeCode);

    if ((typeCode & TM_INTERFACE) == 0 || ! classDef.isInterface()) {
        throw new CompilerError("Not an interface");
    }
}
 
Example 7
Source File: ClassType.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a ClassType instance for the given class. NOTE: This constructor
 * is ONLY for SpecialClassType.
 */
protected ClassType(ContextStack stack, int typeCode, ClassDefinition classDef) {
    super(stack,typeCode,classDef); // Call special parent constructor.
    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 8
Source File: ClassType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a ClassType instance for the given class. NOTE: This constructor
 * is ONLY for SpecialClassType.
 */
protected ClassType(ContextStack stack, int typeCode, ClassDefinition classDef) {
    super(stack,typeCode,classDef); // Call special parent constructor.
    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 9
Source File: InterfaceType.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a InterfaceType instance for the given class.  The resulting
 * object is not yet completely initialized. Subclasses must call
 * initialize(directInterfaces,directInterfaces,directConstants);
 */
protected InterfaceType(ContextStack stack,
                        ClassDefinition classDef,
                        int typeCode) {
    super(stack,classDef,typeCode);

    if ((typeCode & TM_INTERFACE) == 0 || ! classDef.isInterface()) {
        throw new CompilerError("Not an interface");
    }
}
 
Example 10
Source File: ClassType.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a ClassType instance for the given class. NOTE: This constructor
 * is ONLY for SpecialClassType.
 */
protected ClassType(ContextStack stack, int typeCode, ClassDefinition classDef) {
    super(stack,typeCode,classDef); // Call special parent constructor.
    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 11
Source File: InterfaceType.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a InterfaceType instance for the given class. NOTE: This constructor
 * is ONLY for SpecialInterfaceType.
 */
protected InterfaceType(ContextStack stack, int typeCode, ClassDefinition classDef) {
    super(stack,typeCode,classDef); // Call special parent constructor.

    if ((typeCode & TM_INTERFACE) == 0 || ! classDef.isInterface()) {
        throw new CompilerError("Not an interface");
    }
}
 
Example 12
Source File: ClassType.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create an ClassType instance for the given class.  The resulting
 * object is not yet completely initialized. Subclasses must call
 * initialize(directInterfaces,directInterfaces,directConstants);
 */
protected ClassType(ContextStack stack,
                    ClassDefinition classDef,
                    int typeCode) {
    super(stack,classDef,typeCode);
    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 13
Source File: ClassType.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a ClassType instance for the given class. NOTE: This constructor
 * is ONLY for ImplementationType. It does not walk the parent chain.
 */
protected ClassType(int typeCode, ClassDefinition classDef,ContextStack stack) {
    super(stack,classDef,typeCode);

    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 14
Source File: ClassType.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a ClassType instance for the given class. NOTE: This constructor
 * is ONLY for SpecialClassType.
 */
protected ClassType(ContextStack stack, int typeCode, ClassDefinition classDef) {
    super(stack,typeCode,classDef); // Call special parent constructor.
    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 15
Source File: ClassType.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a ClassType instance for the given class. NOTE: This constructor
 * is ONLY for SpecialClassType.
 */
protected ClassType(ContextStack stack, int typeCode, ClassDefinition classDef) {
    super(stack,typeCode,classDef); // Call special parent constructor.
    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 16
Source File: InterfaceType.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a InterfaceType instance for the given class. NOTE: This constructor
 * is ONLY for SpecialInterfaceType.
 */
protected InterfaceType(ContextStack stack, int typeCode, ClassDefinition classDef) {
    super(stack,typeCode,classDef); // Call special parent constructor.

    if ((typeCode & TM_INTERFACE) == 0 || ! classDef.isInterface()) {
        throw new CompilerError("Not an interface");
    }
}
 
Example 17
Source File: ClassType.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create an ClassType instance for the given class.  The resulting
 * object is not yet completely initialized. Subclasses must call
 * initialize(directInterfaces,directInterfaces,directConstants);
 */
protected ClassType(ContextStack stack,
                    ClassDefinition classDef,
                    int typeCode) {
    super(stack,classDef,typeCode);
    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 18
Source File: ClassType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create an ClassType instance for the given class.  The resulting
 * object is not yet completely initialized. Subclasses must call
 * initialize(directInterfaces,directInterfaces,directConstants);
 */
protected ClassType(ContextStack stack,
                    ClassDefinition classDef,
                    int typeCode) {
    super(stack,classDef,typeCode);
    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 19
Source File: ClassType.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create an ClassType instance for the given class.  The resulting
 * object is not yet completely initialized. Subclasses must call
 * initialize(directInterfaces,directInterfaces,directConstants);
 */
protected ClassType(ContextStack stack,
                    ClassDefinition classDef,
                    int typeCode) {
    super(stack,classDef,typeCode);
    if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
        throw new CompilerError("Not a class");
    }
    parent = null;
}
 
Example 20
Source File: StubGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Create and return a top-level type.
 * @param cdef The top-level class definition.
 * @param stack The context stack.
 * @return The compound type or null if is non-conforming.
 */
protected CompoundType getTopType(ClassDefinition cdef, ContextStack stack) {

    CompoundType result = null;

    // Do we have an interface?

    if (cdef.isInterface()) {

        // Yes, so first try Abstract...

        result = AbstractType.forAbstract(cdef,stack,true);

        if (result == null) {

            // Then try Remote...

            result = RemoteType.forRemote(cdef,stack,false);
        }
    } else {

        // Not an interface, so try Implementation...

        result = ImplementationType.forImplementation(cdef,stack,false);
    }

    return result;
}