Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.parameters()


            // Add AsyncCallback parameter
            SingleVariableDeclaration asyncCallbackParam = ast.newSingleVariableDeclaration();
            asyncCallbackParam.setName(ast.newSimpleName("callback")); //$NON-NLS-1$
            asyncCallbackParam.setType(ast.newSimpleType(ast.newName("AsyncCallback"))); //$NON-NLS-1$
            aMethod.parameters().add(asyncCallbackParam);
           
            // Remove throws
            aMethod.thrownExceptions().clear();
           
            // Remove @gwt tags
View Full Code Here


      asyncCallbackType = createAsyncCallbackType(ast, returnType);
    else
      asyncCallbackType = ast.newSimpleType(ast.newName("AsyncCallback")); //$NON-NLS-1$

    asyncCallbackParam.setType(asyncCallbackType);
    aMethod.parameters().add(asyncCallbackParam);

    // Remove throws
    aMethod.thrownExceptions().clear();

    // Remove @gwt tags
View Full Code Here

        SingleVariableDeclaration checkpoint = ast
                .newSingleVariableDeclaration();
        String checkpointType = getClassName(Checkpoint.class, state, root);
        checkpoint.setType(createType(ast, checkpointType));
        checkpoint.setName(ast.newSimpleName("checkpoint"));
        method.parameters().add(checkpoint);

        // Return type is Object.
        method.setReturnType2(createType(ast, getClassName(Object.class, state,
                root)));
View Full Code Here

                    .newSingleVariableDeclaration();
            String checkpointType = getClassName(Checkpoint.class, state, root);
            checkpoint.setType(ast
                    .newSimpleType(createName(ast, checkpointType)));
            checkpoint.setName(ast.newSimpleName(CHECKPOINT_NAME));
            method.parameters().add(checkpoint);
        }

        if (special && _assignOperators.containsKey(fieldTypeName)) {
            // Add an operator parameter.
            SingleVariableDeclaration operator = ast
View Full Code Here

            // Add an operator parameter.
            SingleVariableDeclaration operator = ast
                    .newSingleVariableDeclaration();
            operator.setType(ast.newPrimitiveType(PrimitiveType.INT));
            operator.setName(ast.newSimpleName("operator"));
            method.parameters().add(operator);
        }

        // Add all the indices.
        for (int i = 0; i < indices; i++) {
            SingleVariableDeclaration index = ast
View Full Code Here

        for (int i = 0; i < indices; i++) {
            SingleVariableDeclaration index = ast
                    .newSingleVariableDeclaration();
            index.setType(ast.newPrimitiveType(PrimitiveType.INT));
            index.setName(ast.newSimpleName("index" + i));
            method.parameters().add(index);
        }

        // Add a new value argument with name "newValue".
        SingleVariableDeclaration argument = ast.newSingleVariableDeclaration();
        argument.setType((org.eclipse.jdt.core.dom.Type) ASTNode.copySubtree(
View Full Code Here

        // Add a new value argument with name "newValue".
        SingleVariableDeclaration argument = ast.newSingleVariableDeclaration();
        argument.setType((org.eclipse.jdt.core.dom.Type) ASTNode.copySubtree(
                ast, type));
        argument.setName(ast.newSimpleName("newValue"));
        method.parameters().add(argument);

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

                    .newSingleVariableDeclaration();
            String checkpointType = getClassName(Checkpoint.class, state, root);
            checkpoint.setType(ast
                    .newSimpleType(createName(ast, checkpointType)));
            checkpoint.setName(ast.newSimpleName(CHECKPOINT_NAME));
            method.parameters().add(checkpoint);
        }

        // Add all the indices.
        for (int i = 0; i < indices; i++) {
            SingleVariableDeclaration index = ast
View Full Code Here

        for (int i = 0; i < indices; i++) {
            SingleVariableDeclaration index = ast
                    .newSingleVariableDeclaration();
            index.setType(ast.newPrimitiveType(PrimitiveType.INT));
            index.setName(ast.newSimpleName("index" + i));
            method.parameters().add(index);
        }

        Block body = ast.newBlock();
        method.setBody(body);
View Full Code Here

        // Add a timestamp parameter.
        SingleVariableDeclaration timestamp = ast
                .newSingleVariableDeclaration();
        timestamp.setType(ast.newPrimitiveType(PrimitiveType.LONG));
        timestamp.setName(ast.newSimpleName("timestamp"));
        method.parameters().add(timestamp);

        // Return type default to "void".
        if (!isInterface) {
            // The method body.
            Block body = ast.newBlock();
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.