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

IClass.IMethod org::codehaus::janino::UnitCompiler::findIMethod ( Locatable  l,
IClass  targetType,
String  methodName,
Rvalue[]  arguments 
) throws CompileException [inline, private]

Find IClass.IMethod by name and argument types. If more than one such method exists, choose the most specific one (JLS 15.11.2).

Notice that the returned IClass.IMethod may be declared in an enclosing type.

null if no appropriate method could be found

Definition at line 5603 of file UnitCompiler.java.

        for (IClass ic = targetType; ic != null; ic = ic.getDeclaringIClass()) {
            List ms = new ArrayList();
            this.getIMethods(ic, methodName, ms);
            if (ms.size() > 0) {

                // Determine arguments' types, choose the most specific method
                IClass.IMethod iMethod = (IClass.IMethod) this.findMostSpecificIInvocable(
                    l,                                                            // l
                    (IClass.IMethod[]) ms.toArray(new IClass.IMethod[ms.size()]), // iInvocables
                    arguments                                                     // arguments
                return iMethod;
        return null;

Generated by  Doxygen 1.6.0   Back to index