Examples of newReturnStatement()


Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newReturnStatement()

                        .method("hashCode") //$NON-NLS-1$
                        .toExpression())
                    .toExpression())
                .toStatement());
        }
        statements.add(f.newReturnStatement(result));

        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newReturnStatement()

        SimpleName obj = context.createVariableName("obj"); //$NON-NLS-1$
        statements.add(f.newIfStatement(
                new ExpressionBuilder(f, f.newThis())
                    .apply(InfixOperator.EQUALS, obj)
                    .toExpression(),
                f.newBlock(f.newReturnStatement(Models.toLiteral(f, true)))));
        statements.add(f.newIfStatement(
                new ExpressionBuilder(f, obj)
                    .apply(InfixOperator.EQUALS, Models.toNullLiteral(f))
                    .toExpression(),
                f.newBlock(f.newReturnStatement(Models.toLiteral(f, false)))));
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newReturnStatement()

                f.newBlock(f.newReturnStatement(Models.toLiteral(f, true)))));
        statements.add(f.newIfStatement(
                new ExpressionBuilder(f, obj)
                    .apply(InfixOperator.EQUALS, Models.toNullLiteral(f))
                    .toExpression(),
                f.newBlock(f.newReturnStatement(Models.toLiteral(f, false)))));
        statements.add(f.newIfStatement(
                new ExpressionBuilder(f, f.newThis())
                    .method("getClass") //$NON-NLS-1$
                    .apply(InfixOperator.NOT_EQUALS, new ExpressionBuilder(f, obj)
                        .method("getClass") //$NON-NLS-1$
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newReturnStatement()

                    .method("getClass") //$NON-NLS-1$
                    .apply(InfixOperator.NOT_EQUALS, new ExpressionBuilder(f, obj)
                        .method("getClass") //$NON-NLS-1$
                        .toExpression())
                    .toExpression(),
                f.newBlock(f.newReturnStatement(Models.toLiteral(f, false)))));
        SimpleName other = context.createVariableName("other"); //$NON-NLS-1$
        Type self = context.resolve(context.getQualifiedTypeName());
        statements.add(new ExpressionBuilder(f, obj)
            .castTo(self)
            .toLocalVariableDeclaration(self, other));
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newReturnStatement()

                        .method("equals", new ExpressionBuilder(f, other) //$NON-NLS-1$
                            .field(field)
                            .toExpression())
                        .apply(InfixOperator.EQUALS, Models.toLiteral(f, false))
                        .toExpression(),
                    f.newBlock(f.newReturnStatement(Models.toLiteral(f, false)))));
        }
        statements.add(f.newReturnStatement(Models.toLiteral(f, true)));

        return f.newMethodDeclaration(
                null,
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newReturnStatement()

                            .toExpression())
                        .apply(InfixOperator.EQUALS, Models.toLiteral(f, false))
                        .toExpression(),
                    f.newBlock(f.newReturnStatement(Models.toLiteral(f, false)))));
        }
        statements.add(f.newReturnStatement(Models.toLiteral(f, true)));

        return f.newMethodDeclaration(
                null,
                new AttributeBuilder(f)
                    .annotation(context.resolve(Override.class))
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newReturnStatement()

    private Block createRunMethodBody(ASTRewrite rewrite, ClassInstanceCreation classLoaderCreation) {
        AST ast = rewrite.getAST();

        Block methodBody = ast.newBlock();
        ReturnStatement returnStatement = ast.newReturnStatement();
        List<Statement> statements = checkedList(methodBody.statements());

        statements.add(returnStatement);
        returnStatement.setExpression((ClassInstanceCreation) rewrite.createCopyTarget(classLoaderCreation));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.