Package org.eclipse.jdt.core.dom

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


            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

                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

            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

        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

        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

                .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

        // 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

        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

                if (isFinal) {
                    if ((_getAccessedField(currentClass.getName(), fieldName) != null)
                            || !Type.isPrimitive(Type.getElementType(fieldType
                                    .getName()))) {
                        body.statements().add(
                                ast.newExpressionStatement(restoreMethodCall));
                    }
                } else {
                    Expression rightHandSide;
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.