Examples of statements()


Examples of org.eclipse.jdt.core.dom.Block.statements()

        // The second statement: return the array.
        ReturnStatement returnStatement = ast.newReturnStatement();
        returnStatement.setExpression((Expression) ASTNode.copySubtree(ast,
                field));
        body.statements().add(returnStatement);

        // If the field is static, the method is also static; the method
        // is also private.
        List modifiers = method.modifiers();
        modifiers
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

            MethodInvocation topTimestamp = ast.newMethodInvocation();
            topTimestamp.setExpression(ast
                    .newSimpleName(CHECKPOINT_RECORD_NAME));
            topTimestamp.setName(ast.newSimpleName("getTopTimestamp"));
            commitFields.arguments().add(topTimestamp);
            body.statements().add(ast.newExpressionStatement(commitFields));

            // Add a call to the commit method in the superclass, if necessary.
            SuperMethodInvocation superRestore = ast.newSuperMethodInvocation();
            superRestore
                    .setName(ast.newSimpleName(_getCommitMethodName(false)));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

            if ((parent != null)
                    && (state.getCrossAnalyzedTypes()
                            .contains(parent.getName()) || hasMethod(parent,
                            methodName,
                            new Class[] { int.class, boolean.class }))) {
                body.statements().add(ast.newExpressionStatement(superRestore));
            } else {
                // Commit the checkpoint record.
                MethodInvocation commitCheckpoint = ast.newMethodInvocation();
                commitCheckpoint.setExpression(ast
                        .newSimpleName(CHECKPOINT_RECORD_NAME));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

                commitCheckpoint.setExpression(ast
                        .newSimpleName(CHECKPOINT_RECORD_NAME));
                commitCheckpoint.setName(ast.newSimpleName("commit"));
                commitCheckpoint.arguments()
                        .add(ast.newSimpleName("timestamp"));
                body.statements().add(
                        ast.newExpressionStatement(commitCheckpoint));

                if (parent != null) {
                    addToLists(_nodeSubstitution, parent.getName(),
                            new NodeReplace(commitCheckpoint, superRestore));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

            Block body = ast.newBlock();
            method.setBody(body);

            ReturnStatement returnStatement = ast.newReturnStatement();
            returnStatement.setExpression(ast.newSimpleName(CHECKPOINT_NAME));
            body.statements().add(returnStatement);
        }

        method.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        if (!isInterface) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

        MethodInvocation invocation = ast.newMethodInvocation();
        invocation.setName(ast.newSimpleName(_getCommitMethodName(true)));
        invocation.arguments().add(ast.newSimpleName("timestamp"));

        Block body = ast.newBlock();
        body.statements().add(ast.newExpressionStatement(invocation));
        commit.setBody(body);

        commit.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        commit.modifiers().add(
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

        invocation.setName(ast.newSimpleName(_getRestoreMethodName(true)));
        invocation.arguments().add(ast.newSimpleName("timestamp"));
        invocation.arguments().add(ast.newSimpleName("trim"));

        body = ast.newBlock();
        body.statements().add(ast.newExpressionStatement(invocation));
        restore.setBody(body);

        restore.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        restore.modifiers().add(
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

                .setName(ast.newSimpleName(_getGetCheckpointMethodName(true)));
        body = ast.newBlock();

        ReturnStatement returnStatement = ast.newReturnStatement();
        returnStatement.setExpression(invocation);
        body.statements().add(returnStatement);
        getCheckpoint.setBody(body);

        getCheckpoint.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        getCheckpoint.modifiers().add(
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

        // Return this object.
        returnStatement = ast.newReturnStatement();
        returnStatement.setExpression(ast.newThisExpression());

        body = ast.newBlock();
        body.statements().add(ast.newExpressionStatement(invocation));
        body.statements().add(returnStatement);
        setCheckpoint.setBody(body);

        setCheckpoint.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

        returnStatement = ast.newReturnStatement();
        returnStatement.setExpression(ast.newThisExpression());

        body = ast.newBlock();
        body.statements().add(ast.newExpressionStatement(invocation));
        body.statements().add(returnStatement);
        setCheckpoint.setBody(body);

        setCheckpoint.modifiers().add(
                ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        setCheckpoint.modifiers().add(
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.