Package org.eclipse.jdt.core.dom

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


    for (int i = 0; i < signature.length; i++) {
      SingleVariableDeclaration var = (SingleVariableDeclaration) method.parameters().get(i);
      Type type = var.getType();

      ITypeBinding typeBinding = type.resolveBinding();

      if (!(typeBinding.getQualifiedName().toString().equals(signature[i]))) {
        return false;
      }
    }

    return true;
View Full Code Here


   
    for (int i = 0; i < methodDeclaration.parameters().size(); i++) {
      SingleVariableDeclaration var = (SingleVariableDeclaration) methodDeclaration.parameters().get(i);
      Type type = var.getType();

      ITypeBinding typeBinding = type.resolveBinding();
      String param = typeBinding.getQualifiedName().toString();
      params.add(param);
    }
   
    return params.toArray(new String[params.size()]);
  }
View Full Code Here

   
    methodDeclaration.accept(new ASTVisitor() {

      @Override
      public boolean visit(MethodInvocation node) {
        ITypeBinding declaringClass = node.resolveMethodBinding().getDeclaringClass();
       
        if (interfacesToFind.contains(declaringClass.getQualifiedName())) {
          Dependency dependency = new Dependency();
         
          // this is wrong!
          String dependsOn = model.getBeanForInterface(declaringClass.getQualifiedName());
          dependency.setDependsOn(dependsOn);
         
          dependency.addMethodCall(methodCall);
          results.add(dependency);
        } else {
View Full Code Here

    }
  }

  protected boolean isSingleton(IType type) {
    TypeDeclaration typeDeclaration = cache.getTypeDeclaration(type);
    ITypeBinding typeBinding = typeDeclaration.resolveBinding();
   
    IAnnotationBinding[] annotations = typeBinding.getAnnotations();
    for (IAnnotationBinding annotation : annotations) {
      String qualifiedName = annotation.getAnnotationType().getQualifiedName();
      if ("javax.ejb.Singleton".equals(qualifiedName)) {
        return true;
      }
View Full Code Here

          .or(AccessInfo.DEFAULT);
    }

    @Override
    public SimpleTypeInfo getReturnTypeInfo() {
      ITypeBinding type = binding.getReturnType();
      return ITypeBindingWrapper.wrapperOf(type)
          .toSimpleTypeInfo();
    }
View Full Code Here

  @Override
  Optional<PackageInfo> getPackageInfo() {
    Optional<PackageInfo> res = super.getPackageInfo();

    ITypeBinding binding = type.resolveBinding();
    if (binding != null) {
      IPackageBinding pkg = binding.getPackage();
      PackageInfo packageInfo = IPackageBindingWrapper.wrapperOf(pkg)
          .toPackageInfo();
      res = Optional.of(packageInfo);
    }
View Full Code Here

  }

  public SimpleTypeInfo toSimpleTypeInfo() {
    SimpleTypeInfo res = new SimpleTypeInfoBuilder().build();

    ITypeBinding binding = type.resolveBinding();
    if (binding != null) {
      res = ITypeBindingWrapper.wrapperOf(binding)
          .toSimpleTypeInfo();
    }
View Full Code Here

      if (!isAbstractMethod)
        return false;

      // filter out annotation value references
      if (binding != null) {
        ITypeBinding declaringType= ((IMethodBinding)binding).getDeclaringClass();
        if (declaringType.isAnnotation())
          return false;
      }

      return true;
    }
View Full Code Here

      IBinding binding= token.getBinding();
      if (binding == null || binding.getKind() != IBinding.METHOD)
        return false;

      ITypeBinding currentType= Bindings.getBindingOfParentType(node);
      ITypeBinding declaringType= ((IMethodBinding) binding).getDeclaringClass();
      if (currentType == declaringType || currentType == null)
        return false;

      return Bindings.isSuperType(declaringType, currentType);
    }
View Full Code Here

    }
       
    if(current!=root){
      TypeDeclaration classDecl = (TypeDeclaration) current;
      //the Binding representing the Type
      ITypeBinding classBinding = classDecl.resolveBinding();
      //the name of the class
      String name = classBinding.getName();
      //the Package that class is declared in
      packageBinding = classBinding.getPackage();
     
      //calculate the fields and methods of the class
      IVariableBinding[] vb = classBinding.getDeclaredFields();
      IMethodBinding[] mb = classBinding.getDeclaredMethods();
     
      //insert the fields and methods into the Lists
      for (int i=0; i<vb.length;i++){
        fields.add(new VarProposal(vb[i], name));
      }
      for (int i=0; i<mb.length;i++){
        methods.add(new MethProposal(mb[i], name));
      }
     
      //calculate the global fields and methods of the super classes
      ITypeBinding parent= classBinding.getSuperclass();
      fields.addAll(getGlobalFields(parent, true));
      methods.addAll(getGlobalMethods(parent, true));
     
    }
    ArrayList[] result = {fields, methods, locals};
View Full Code Here

TOP

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

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.