Package org.eclipse.jdt.core.dom

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


    return AstEvaluationEngine.UNKNOWN;
  }

  private static void useNotNullArgument(ClassInstanceCreation expression, Object[] arguments)
      throws Exception {
    IMethodBinding binding = AstNodeUtils.getCreationBinding(expression);
    ITypeBinding[] parameterTypes = binding.getParameterTypes();
    for (int i = 0; i < parameterTypes.length; i++) {
      ITypeBinding parameterType = parameterTypes[i];
      if (arguments[i] == null) {
        ClassLoader classLoader = JavaInfoUtils.getClassLoader(EditorState.getActiveJavaInfo());
        if (AstNodeUtils.isSuccessorOf(
View Full Code Here


            if ((binding == null) || (binding.getKind() != IBinding.METHOD)) {
                return false;
            }

            IMethodBinding methodBinding = (IMethodBinding) binding;

            return _testMethod(methodBinding);
        }
View Full Code Here

    }

    @Override
    public boolean visit(ConstructorInvocation node) {
      if (fJobDeprecatedMemberHighlighting != null) {
        IMethodBinding constructorBinding = node
            .resolveConstructorBinding();
        if (constructorBinding != null
            && constructorBinding.isDeprecated()) {
          int offset = node.getStartPosition();
          int length = 4;
          if (offset > -1 && length > 0) {
            offset = fDocumentSynchronizer.mapToATG(offset, node);
          }
View Full Code Here

    }

    @Override
    public boolean visit(SuperConstructorInvocation node) {
      if (fJobDeprecatedMemberHighlighting != null) {
        IMethodBinding constructorBinding = node
            .resolveConstructorBinding();
        if (constructorBinding != null
            && constructorBinding.isDeprecated()) {
          int offset = node.getStartPosition();
          int length = 5;
          if (offset > -1 && length > 0) {
            offset = fDocumentSynchronizer.mapToATG(offset, node);
          }
View Full Code Here

    if(action.isMethod()){
      //search for the semantic action within the method proposal list
      for(int i=0; i<methods.size();i++){
        if(methods.get(i).getName().equals(action.getName())){
          //proposal has been found
          IMethodBinding b = methods.get(i).getBinding();
          ITypeBinding type = b.getReturnType();
         
          if(arrayLevel > type.getDimensions()){
            //the number of array parameters written at the operation has exceeded the actual array dimension of this type
            return null;
          }
          while (arrayLevel > 0){
            //get the containing element of the array
            type = type.getComponentType();
            arrayLevel--;
          }
         
          //if the return type of the method is void, ignore this Method
          if(!type.getName().equals("void")){
            completionProposals =  calculateSemanticFieldsAndMethds(type);
            if(iteration == size){
              //end of Statement has been reached, return the calculated proposals
              return completionProposals;
            }
            else{
              //calculate the semantic proposals for the next iteration
              completionProposals = calculateSemanticFieldsAndMethods(iteration+1, semanticActions, extractFields(completionProposals), extractMethods(completionProposals));
              if(completionProposals!=null){
                return completionProposals;
              }
            }
          }
        }
      }
    }
    else{ // if action is a Variable
      //search for the semantic action within the variable proposal list
      for(int i=0; i<fields.size(); i++){
        if(fields.get(i).getName().equals(action.getName())){
          //proposal has been found
          IVariableBinding b = fields.get(i).getBinding();
          ITypeBinding type = b.getType();
          if(arrayLevel > type.getDimensions()){
            //the number of array parameters written at the operation has exceeded the actual array dimension of this type
            return null;
          }
          while (arrayLevel > 0){
View Full Code Here

      //array containing all the methods
      IMethodBinding[] mb = b.getDeclaredMethods();
     
      //add all the global proposals within the array into the list.
      for(int i = 0; i<mb.length;i++){
        IMethodBinding temp = mb[i];
        int modifier = temp.getModifiers();
       
        //find out if the current type has been declared in the same package
        //as the class where code completion has been called
        boolean isSamePackage = false;
        if(temp.getDeclaringClass().getPackage().equals(packageBinding)){
          isSamePackage=true;
        }
       
        if(Modifier.isPublic(modifier)||(Modifier.isProtected(modifier) && inherited)||(isSamePackage && !Modifier.isPrivate(modifier) && !Modifier.isProtected(modifier))){
          MethProposal entry = new MethProposal(temp, name);
View Full Code Here

    //array containing all the methods
    IMethodBinding[] mb = b.getDeclaredMethods();
   
    //add all the global proposals within the array into the list.
    for(int i = 0; i<mb.length;i++){
      IMethodBinding temp = mb[i];
      if(Modifier.isPrivate(temp.getModifiers())){
        methods.add(new MethProposal(temp, name));
      }
    }
    return methods;
  }
View Full Code Here

  }
 
 
  private void generateConservativeConstraints(ITypeBinding type) {
    IVariableBinding f[] = type.getDeclaredFields();
    IMethodBinding m[] = type.getDeclaredMethods();
   
   
    /*
    for(int i=0; i<f.length; i++){
      ITypeBinding ft = f[i].getType();
View Full Code Here

          .getAnonymousClassDeclaration();
      final ITypeBinding binding = acd.resolveBinding();
      final ITypeBinding superBinding = binding.getSuperclass();
      for (final Iterator it = Arrays.asList(
          superBinding.getDeclaredMethods()).iterator(); it.hasNext();) {
        final IMethodBinding imb = (IMethodBinding) it.next();
        if (imb.isConstructor()) {
          final ITypeBinding[] itb = imb.getParameterTypes();
          if (itb.length > paramNumber) {
            final ITypeBinding ithParamType = itb[paramNumber];
            if (ithParamType.isEqualTo(((Expression) ctorCall
                .arguments().get(paramNumber))
                .resolveTypeBinding())) {
              meth = (IMethod) imb.getJavaElement();
              break;
            }
          }
        }
      }
View Full Code Here

     *
     * @see org.evolizer.famix.importer.nodehandler.AbstractInvocationHandler#initMethodBinding()
     */
    @Override
    public void initMethodBinding() {
        IMethodBinding lMethodBinding = getASTNode().resolveMethodBinding();
        if (lMethodBinding != null) {
            setMethodBinding(lMethodBinding.getMethodDeclaration());
        }
    }
View Full Code Here

TOP

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

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.