Examples of ITypeBinding


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

  @Override
  public void endVisit(ThrowStatement node) {
    EclipseCFGNode throwNode = nodeMap.get(node);
    EclipseCFGNode expNode = nodeMap.get(node.getExpression());
    ITypeBinding binding = node.getExpression().resolveTypeBinding();
    EclipseCFGNode catchNode = exceptionMap.getCatchNode(binding);
    EclipseCFGNode current = throwNode;

    createEdge(expNode.getEnd(), throwNode);
View Full Code Here

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

   *
   * @param annoBinding
   * @return true id this is a multi annotation, and false if it is not.
   */
  public boolean isMulti(IAnnotationBinding annoBinding) {
    ITypeBinding binding = annoBinding.getAnnotationType();

    for (IAnnotationBinding meta : binding.getAnnotations()) {
      if (meta.getAnnotationType().getQualifiedName().equals(MULTI_ANNOTATION_CLASSNAME))
        return true;
    }
    return false;
  }
View Full Code Here

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

    else
      existing.add(anno);
  }

  public void addAnnotationToType(ICrystalAnnotation anno, TypeDeclaration type) {
    ITypeBinding binding = type.resolveBinding();
    String name = binding.getKey();
    List<ICrystalAnnotation> annoList;

    annoList = classes.get(name);
    if (annoList == null) {
      annoList = new ArrayList<ICrystalAnnotation>();
View Full Code Here

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

    return tf.transfer(this, labels, value);
  }

  @Override
  public String toString() {
    ITypeBinding t = getCastToTypeNode().resolveBinding();
    if(t == null)
      return getTarget() + " = (<Cast>) " + getOperand();
    return getTarget() + " = (" + t.getName() + ") " + getOperand();
  }
View Full Code Here

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

  /**
   * Returns the represented method's (unqualified) <code>this</code>.
   * @return the represented method's (unqualified) <code>this</code>.
   */
  public ThisVariable thisVariable() {
    ITypeBinding thisBinding = resolveThisType();
    if(thisBinding == null)
      // static method
      return null;
   
    ThisVariable result = thisVar.get(thisBinding);
View Full Code Here

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

    if(isStaticBinding(accessedElement))
      throw new IllegalArgumentException("Accessed element is static: " + accessedElement);
    if(isStaticBinding(method))
      throw new IllegalStateException("Access happens in static method: " + accessedElement);
   
    ITypeBinding thisBinding = implicitThisBinding(accessedElement);
    boolean implicitQualifier = thisBinding.equals(method.getDeclaringClass()) == false;
    // TODO can this happen?
    if(thisBinding.getName().equals("") && implicitQualifier) {
      // true if (1) binding is an anonymous class and (2) binding is not the innermost class around the current method
      // not sure how to qualify "this" in this case
      throw new IllegalArgumentException("implicit this resolves not to innermost class: " + accessedElement);
    }
   
View Full Code Here

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

        throw new IllegalArgumentException("Invalid element for implicit this: " + accessedElement);
      genericBinding = ((IVariableBinding) accessedElement).getVariableDeclaration();
      isMethod = false;
    }
   
    ITypeBinding scope = method.getDeclaringClass();
    if(scope.isTopLevel())
      // easy: we're in a top-level class
      // this must bind to that class (no lexically enclosing classes exist)
      return scope;
    while(scope != null) {
      if(findElementDeclarationByName(genericBinding, isMethod, scope, false, false) != null)
        return scope;
      scope = scope.getDeclaringClass();
    }
    throw new IllegalArgumentException("Unknown element: " + accessedElement);
  }
View Full Code Here

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

        if(genericAccessedElement.equals(b.getVariableDeclaration() /* use generic field */))
          return type;
      }
    }
   
    ITypeBinding result = null;
    if(type.getSuperclass() != null) {
      ITypeBinding t = type.getSuperclass();
      result = findElementDeclarationByName(
          genericAccessedElement, isMethod, t,
          true /* always skip private declarations in supertypes */,
          ! t.getPackage().equals(type.getPackage()) /* skip package-private when leaving current package */);
      if(result != null)
        return result;
    }
    // go though interfaces as well
    for(ITypeBinding i : type.getInterfaces()) {
View Full Code Here

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

    }
    return result;
  }
 
  public SuperVariable superVariable(Name qualifier) {
    ITypeBinding thisType = resolveThisType();
    if(thisType == null || thisType.getSuperclass() == null)
      // static method or no superclass
      return null;
   
    // TODO find super-type binding based on qualifier and accessed element
    SuperVariable result = superVar.get(qualifier);
View Full Code Here

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

          declaredIn = declaredIn.getMethodDeclaration();
        }
        result = new SourceVariable(vb.getName(), vb, method.equals(declaredIn));
      }
      else if(binding instanceof ITypeBinding) {
        ITypeBinding tb = (ITypeBinding) binding;
        result = new TypeVariable(tb);
      }
      else
        throw new IllegalArgumentException("Not a variable: " + binding);
      variables.put(binding, result);
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.