Examples of newSimpleType()


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

      cunit.recordModifications();
      AST ast = cunit.getAST();
      TypeDeclaration typeDec = (TypeDeclaration) cunit.types().get(0);
      List list = typeDec.superInterfaceTypes();
      Name name = ast.newName(cName);
      Type interfaceType = ast.newSimpleType(name);
      list.add(interfaceType);
      TextEdit edits = cunit.rewrite(document, icunit.getJavaProject()
          .getOptions(true));
      edits.apply(document);
      String newSource = document.get();
View Full Code Here

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

            aMethod.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));

            // 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();
View Full Code Here

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

            aMethod.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));

            // 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();
           
View Full Code Here

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

            aMethod.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));

            // 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();
           
View Full Code Here

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

        if (SPECIAL_TYPE_MAPPING.containsKey(type.getName())) {
            type = Type.createType(SPECIAL_TYPE_MAPPING.get(type.getName()));
            Name newName = createName(ast, getClassName(type.getName(), state,
                    root));
            newNode.setType(ast.newSimpleType(newName));
            Type.setType(node, type);
        }

        String setCheckpointName = SET_CHECKPOINT_NAME;
        MethodInvocation extraSetCheckpoint = ast.newMethodInvocation();
View Full Code Here

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

                // Set the class to implement Rollbackable.
                if (node instanceof TypeDeclaration) {
                    String rollbackType = getClassName(Rollbackable.class,
                            state, root);
                    ((TypeDeclaration) node).superInterfaceTypes().add(
                            ast.newSimpleType(createName(ast, rollbackType)));
                }

                if (!isInterface) {
                    // Create a checkpoint field.
                    FieldDeclaration checkpointField = _createCheckpointField(
View Full Code Here

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

            addInvocation.setExpression(ast.newSimpleName(CHECKPOINT_NAME));
            addInvocation.setName(ast.newSimpleName("addObject"));

            ClassInstanceCreation proxy = ast.newClassInstanceCreation();
            proxy
                    .setType(ast.newSimpleType(ast
                            .newSimpleName(_getProxyName())));
            addInvocation.arguments().add(proxy);
            body.statements().add(ast.newExpressionStatement(addInvocation));
            bodyDeclarations.add(initializer);
View Full Code Here

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

        Expression objExpr = createAnnotationPropertyValueExpression(cu, type.getComponentType(), object);
        ((ArrayInitializer) expression).expressions().add(objExpr);
      }
    } else if ((value instanceof String) && (type == Class.class)) {
      expression = ast.newTypeLiteral();
      SimpleType newSimpleType = ast.newSimpleType(ast.newName((String) value));
      ((TypeLiteral) expression).setType(newSimpleType);

      addImportToCompilationUnit((String) value, cu);
    } else if (value instanceof String) {
      expression = ast.newStringLiteral();
View Full Code Here

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

      CompilationUnit cu = compilationUnitCache.getCompilationUnit(targetClass);
      addImportToCompilationUnit(interfaceClass, cu);

      TypeDeclaration typeDeclaration = compilationUnitCache.getTypeDeclaration(targetClass);
      AST ast = cu.getAST();
      SimpleType interfaceType = ast.newSimpleType(createQualifiedName(ast, interfaceClass));

      typeDeclaration.superInterfaceTypes().add(interfaceType);
    } catch (Exception e) {
      warnings.add(String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.12"), interfaceClass, targetClass)); //$NON-NLS-1$
    }
View Full Code Here

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

                    tagIter.remove();
                  }
                } else if ("@wbp.gwt.Request".equals(tag.getTagName())) {
                  tagIter.remove();
                  addImport(serviceRoot, "com.google.gwt.http.client.Request");
                  methodDeclaration.setReturnType2(ast.newSimpleType(ast.newName("Request")));
                }
              }
              // remove empty JavaDoc
              if (tags.isEmpty()) {
                methodDeclaration.setJavadoc(null);
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.