Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.SingleVariableDeclaration


      boolean isLM = false;
      List params = method.parameters();
      for (Method m : lMethods) {
        if (m.getName().equals(method.getName().getFullyQualifiedName())) {
          if (params != null && params.size() == 1) {
            SingleVariableDeclaration svd = (SingleVariableDeclaration) params.get(0);
            if (!svd.isVarargs()) {
              Type type = svd.getType();
              if (!type.isArrayType() && !type.isParameterizedType() && !type.isPrimitiveType() && !type.isWildcardType()) {
                Class<?>[] types = m.getParameterTypes();
                Class evtType = types[0];
                if (type.isQualifiedType()) {
                  QualifiedType qt = (QualifiedType) type;
View Full Code Here


    String output = "";
    output = md.getName() + "(";
    List params = md.parameters();
    if(params != null && params.size() > 0) {
      Iterator i = params.iterator();
      SingleVariableDeclaration svd;
      while(i.hasNext()) {
        svd = (SingleVariableDeclaration) i.next();
        output += svd.toString();
        if(i.hasNext())
          output += ", ";
      }
    }
    output += ")";
View Full Code Here

    String output = "";
    output = md.getName() + "(";
    List params = md.parameters();
    if(params != null && params.size() > 0) {
      Iterator i = params.iterator();
      SingleVariableDeclaration svd;
      while(i.hasNext()) {
        svd = (SingleVariableDeclaration) i.next();
        output += svd.toString();
        if(i.hasNext())
          output += ", ";
      }
    }
    output += ")";
View Full Code Here

    def.put(getAnalysisContext().getThisVariable(), NullLatticeElement.NOT_NULL);
   
    AnnotationSummary summary = annoDB.getSummaryForMethod(method.resolveBinding());
   
    for (int ndx = 0; ndx < method.parameters().size(); ndx++) {
      SingleVariableDeclaration decl = (SingleVariableDeclaration) method.parameters().get(ndx);
      Variable paramVar = getAnalysisContext().getSourceVariable(decl.resolveBinding());
     
      if (summary.getParameter(ndx, BranchingNPEAnalysis.NON_NULL_ANNO) != null) //is this parameter annotated with @Nonnull?
        def.put(paramVar, NullLatticeElement.NOT_NULL);
    }
   
View Full Code Here

    def.put(getAnalysisContext().getThisVariable(), NullLatticeElement.NOT_NULL);
   
    AnnotationSummary summary = annoDB.getSummaryForMethod(method.resolveBinding());
   
    for (int ndx = 0; ndx < method.parameters().size(); ndx++) {
      SingleVariableDeclaration decl = (SingleVariableDeclaration) method.parameters().get(ndx);
      Variable paramVar = getAnalysisContext().getSourceVariable(decl.resolveBinding());
     
      if (summary.getParameter(ndx, AnnotatedNPEAnalysis.NON_NULL_ANNO) != null) //is this parameter annotated with @Nonnull?
        def.put(paramVar, NullLatticeElement.NOT_NULL);
    }
   
View Full Code Here

            private String getSignature(CompilationUnit ast, MethodDeclaration methodDecl) {
                StringBuilder signatureBuilder = new StringBuilder("(");

                for (@SuppressWarnings("unchecked")
                Iterator<SingleVariableDeclaration> it = methodDecl.parameters().iterator(); it.hasNext();) {
                    SingleVariableDeclaration decl = it.next();
                    appendType(ast, signatureBuilder, decl.getType(), decl.getExtraDimensions());
                }

                signatureBuilder.append(")");

                appendType(ast, signatureBuilder, methodDecl.getReturnType2(), 0);
View Full Code Here

      this.buffer.append(" ");//$NON-NLS-1$
    }
    node.getName().accept(this);
    this.buffer.append("(");//$NON-NLS-1$
    for (Iterator it = node.parameters().iterator(); it.hasNext(); ) {
      SingleVariableDeclaration v = (SingleVariableDeclaration) it.next();
      v.accept(this);
      if (it.hasNext()) {
        this.buffer.append(",");//$NON-NLS-1$
      }
    }
    this.buffer.append(")");//$NON-NLS-1$
View Full Code Here

        assert rewrite != null;
        assert variables != null;
        assert params != null;

        for (Object paramObj : params) {
            SingleVariableDeclaration param = (SingleVariableDeclaration) paramObj;
            if (variables.contains(param.getName().getFullyQualifiedName())) {
                ListRewrite listRewrite = rewrite.getListRewrite(param, SingleVariableDeclaration.MODIFIERS2_PROPERTY);
                listRewrite.insertLast(rewrite.getAST().newModifier(ModifierKeyword.FINAL_KEYWORD), null);
            }
        }
    }
View Full Code Here

            // Make return type void
            MethodDeclaration aMethod = (MethodDeclaration) currDeclaration;
            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

            // Make return type void
            MethodDeclaration aMethod = (MethodDeclaration) currDeclaration;
            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

TOP

Related Classes of org.eclipse.jdt.core.dom.SingleVariableDeclaration

Copyright © 2018 www.massapicom. 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.