Package org.codehaus.groovy.ast.expr

Examples of org.codehaus.groovy.ast.expr.TupleExpression


    public MethodNode tryFindPossibleMethod(String name, Expression arguments) {
        int count = 0;

        if (arguments instanceof TupleExpression) {
            TupleExpression tuple = (TupleExpression) arguments;
            // TODO this won't strictly be true when using list expansion in argument calls
            count = tuple.getExpressions().size();
        } else
            return null;

        MethodNode res = null;
        ClassNode node = this;
        TupleExpression args = (TupleExpression) arguments;
        do {
            for (MethodNode method : node.getMethods(name)) {
                if (method.getParameters().length == count) {
                    boolean match = true;
                    for (int i = 0; i != count; ++i)
                        if (!args.getType().isDerivedFrom(method.getParameters()[i].getType())) {
                            match = false;
                            break;
                        }

                    if (match) {
View Full Code Here


     */
    public boolean hasPossibleStaticMethod(String name, Expression arguments) {
        int count = 0;

        if (arguments instanceof TupleExpression) {
            TupleExpression tuple = (TupleExpression) arguments;
            // TODO this won't strictly be true when using list expansion in argument calls
            count = tuple.getExpressions().size();
        } else if (arguments instanceof MapExpression) {
            count = 1;
        }
       
        for (MethodNode method : getMethods(name)) {
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.ast.expr.TupleExpression

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.