Package sun.tools.java

Examples of sun.tools.java.ClassDefinition


                                          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);;
View Full Code Here


    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);
View Full Code Here

        ClassDeclaration[] except = member.getExceptions(env);
        ValueType[] exceptions = new ValueType[except.length];

        try {
            for (int i = 0; i < except.length; i++) {
                ClassDefinition theClass = except[i].getClassDefinition(env);
                try {
                    ValueType type = ValueType.forValue(theClass,stack,false);
                    if (type != null) {
                            exceptions[i] = type;
                        } else {
                            result = false;
                        }
                } catch (ClassCastException e1) {
                    failedConstraint(22,quiet,stack,getQualifiedName());
                    throw new CompilerError("Method: exception " + theClass.getName() + " not a class type!");
                } catch (NullPointerException e2) {
                    failedConstraint(23,quiet,stack,getQualifiedName());
                    throw new CompilerError("Method: caught null pointer exception");
                }
            }
View Full Code Here

        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;
                        }
View Full Code Here

                }

                // Now remove derived types...
                for (int i = 0; i < list.length; i++) {
                    if (list[i] != null) {
                        ClassDefinition current = list[i].getClassDefinition();
                        for (int j = 0; j < list.length; j++) {
                            if (j != i && list[i] != null && list[j] != null &&
                                current.superClassOf(env, list[j].getClassDeclaration())) {
                                list[j] = null;
                                newSize--;
                            }
                        }
                    }
View Full Code Here

                                                        Vector directMethods,
                                                        Vector directConstants,
                                                        boolean quiet,
                                                        ContextStack stack) {

        ClassDefinition theInterface = getClassDefinition();

        try {

            // Get all remote interfaces...
View Full Code Here

        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) {
View Full Code Here

    /**
     * Initialize this instance.
     */
    private boolean initialize (ContextStack stack, boolean quiet) {

        ClassDefinition ourDef = getClassDefinition();
        ClassDeclaration ourDecl = getClassDeclaration();

        try {

            // Make sure our parentage is ok...

            if (!initParents(stack)) {
                failedConstraint(12,quiet,stack,getQualifiedName());
                return false;
            }


            // We're ok, so make up our collections...

            Vector directInterfaces = new Vector();
            Vector directMethods = new Vector();
            Vector directMembers = new Vector();

            // Get interfaces...

            if (addNonRemoteInterfaces(directInterfaces,stack) != null) {

                // Get methods...

                if (addAllMethods(ourDef,directMethods,false,false,stack) != null) {

                    // Update parent class methods
                    if (updateParentClassMethods(ourDef,directMethods,false,stack) != null) {

                    // Get constants and members...

                    if (addAllMembers(directMembers,false,false,stack)) {

                        // We're ok, so pass 'em up...

                        if (!initialize(directInterfaces,directMethods,directMembers,stack,quiet)) {
                            return false;
                        }

                        // Is this class Externalizable?

                        boolean externalizable = false;
                        if (!env.defExternalizable.implementedBy(env, ourDecl)) {

                            // No, so check to see if we have a serialPersistentField
                            // that will modify the members.

                            if (!checkPersistentFields(getClassInstance(),quiet)) {
                                return false;
                            }
                        } else {

                            // Yes.

                            externalizable = true;
                        }

                        // Should this class be considered "custom"? It is if
                        // it is Externalizable OR if it has a method with the
                        // following signature:
                        //
                        //  private void writeObject(java.io.ObjectOutputStream out);
                        //

                        if (externalizable) {
                            isCustom = true;
                        } else {
                            for (MemberDefinition member = ourDef.getFirstMember();
                                 member != null;
                                 member = member.getNextMember()) {

                                if (member.isMethod() &&
                                    !member.isInitializer() &&
View Full Code Here

     * Initialize this instance.
     */
    private boolean initialize (ContextStack stack, boolean quiet) {

        boolean result = false;
        ClassDefinition theClass = getClassDefinition();

        if (initParents(stack)) {

            // Make up our collections...

View Full Code Here

     * Initialize this instance.
     */
    private boolean initialize (boolean quiet,ContextStack stack) {

        boolean result = false;
        ClassDefinition self = getClassDefinition();

        try {

            // Get methods...

View Full Code Here

TOP

Related Classes of sun.tools.java.ClassDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.