Logo Search packages:      
Sourcecode: janino version File versions  Download package

void org::codehaus::janino::UnitCompiler::getIMethods ( IClass  type,
String  methodName,
List  v 
) throws CompileException [inline]

Add all methods with the given methodName that are declared by the type, its superclasses and all their superinterfaces to the result list v.

Parameters:
type 
methodName 
v 
Exceptions:
CompileException 

Definition at line 5649 of file UnitCompiler.java.

References org::codehaus::janino::IClass::getDeclaredIMethods(), and org::codehaus::janino::IClass::isInterface().

                              {

        // Check methods declared by this type.
        {
            IClass.IMethod[] ims = type.getDeclaredIMethods(methodName);
            for (int i = 0; i < ims.length; ++i) v.add(ims[i]);
        }

        // Check superclass.
        IClass superclass = type.getSuperclass();
        if (superclass != null) this.getIMethods(superclass, methodName, v);

        // Check superinterfaces.
        IClass[] interfaces = type.getInterfaces();
        for (int i = 0; i < interfaces.length; ++i) this.getIMethods(interfaces[i], methodName, v);

        // JLS2 6.4.3
        if (superclass == null && interfaces.length == 0 && type.isInterface()) {
            IClass.IMethod[] oms = this.iClassLoader.OBJECT.getDeclaredIMethods(methodName);
            for (int i = 0; i < oms.length; ++i) {
                IClass.IMethod om = oms[i];
                if (!om.isStatic() && om.getAccess() == Access.PUBLIC) v.add(om);
            }
        }
    }


Generated by  Doxygen 1.6.0   Back to index