Package org.codehaus.groovy.ast.stmt

Examples of org.codehaus.groovy.ast.stmt.ReturnStatement


                new MethodNode("call",
                        Opcodes.ACC_PUBLIC,
                        ClassHelper.OBJECT_TYPE,
                        new Parameter[]{args},
                        ClassNode.EMPTY_ARRAY,
                        new ReturnStatement(doCall1arg)));

        // call()
        MethodCallExpression doCallNoArgs = new MethodCallExpression(new VariableExpression("this"), "doCall", new ArgumentListExpression(new ConstantExpression(null)));
        doCallNoArgs.setImplicitThis(true);
        doCallNoArgs.setMethodTarget(doCallMethod);
        closureClass.addMethod(
                new MethodNode("call",
                        Opcodes.ACC_PUBLIC,
                        ClassHelper.OBJECT_TYPE,
                        Parameter.EMPTY_ARRAY,
                        ClassNode.EMPTY_ARRAY,
                        new ReturnStatement(doCallNoArgs)));
    }
View Full Code Here


                                                    (MethodCallExpression)e.getExpression(),
                                                    parentParent);
                                        }
                                    } else if (statement instanceof ReturnStatement) {
                                        // Single item in block
                                        ReturnStatement e = (ReturnStatement)statement;
                                        if (e.getExpression() instanceof MethodCallExpression) {
                                            checkDslProperty(parent,
                                                    (MethodCallExpression)e.getExpression(),
                                                    parentParent);
                                        }
                                    }
                                }
                            }
View Full Code Here

        gStringStrings.add(new ConstantExpression(""));
        gStringStrings.add(new ConstantExpression(""));
        List<Expression> gStringValues = new ArrayList<Expression>();
        gStringValues.add(new VariableExpression(parameters[0]));
        block.addStatement(
                new ReturnStatement(
                        new AttributeExpression(
                                thiz,
                                new GStringExpression("$name",
                                        gStringStrings,
                                        gStringValues
View Full Code Here

        gStringStrings.add(new ConstantExpression(""));
        gStringStrings.add(new ConstantExpression(""));
        List<Expression> gStringValues = new ArrayList<Expression>();
        gStringValues.add(new VariableExpression(parameters[0]));
        block.addStatement(
                new ReturnStatement(
                        new MethodCallExpression(
                                thiz,
                                new GStringExpression("$name",
                                        gStringStrings,
                                        gStringValues
View Full Code Here

        }
    }

    private void setMethodDefaultValue(MethodNode mn, Method m) {
        Object defaultValue = m.getDefaultValue();
        mn.setCode(new ReturnStatement(new ConstantExpression(defaultValue)));
        mn.setAnnotationDefault(true);
    }
View Full Code Here

                return true;
            }

            Statement statement = statements.get(0);
            if (statement instanceof ReturnStatement) {
                ReturnStatement returnStatement = (ReturnStatement) statement;
                if (returnStatement.getExpression() instanceof ConstantExpression) {
                    ConstantExpression constantExpression = (ConstantExpression) returnStatement.getExpression();
                    if (constantExpression.getValue() == null) {
                        return true;
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.ast.stmt.ReturnStatement

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.