Package org.eclipse.jdt.core.dom

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


    if (node.getExpression() instanceof SimpleName)
    {
      SimpleName var = (SimpleName) node.getExpression();
      String varName = var.getIdentifier();

      IBinding exprBinding = var.resolveBinding();

      if ( "it".equals(varName) && exprBinding instanceof IVariableBinding ) // call on 'it' field
      {
        IVariableBinding varBinding = (IVariableBinding) exprBinding;
        IMethodBinding mockMethod = getSurroundingMockMethod(node);
View Full Code Here


 
  private IValue resolveType(ASTNode node) {
    try {
      if (node instanceof Expression) {
      if (node instanceof Name) {
        IBinding b = ((Name) node).resolveBinding();
        return bindingsResolver.resolveType(b, false);
      }
        ITypeBinding binding = ((Expression) node).resolveTypeBinding();
        return bindingsResolver.resolveType(binding, false);
      }
View Full Code Here

          matches = null;
      }
    }

    if (matches == null) {
      IBinding binding = null;
      if (selectedNode instanceof Name)
        binding = ((Name) selectedNode).resolveBinding();

      if (binding != null && markOccurrencesOfType(binding)) {
        // Find the matches && extract positions so we can forget the
View Full Code Here

   * Example: (2 in 1java.lang.System.out.println("Hello");
   */
  public boolean visit(QualifiedName node) {
    SimpleName name = node.getName();
    Name qualifier = node.getQualifier();
    IBinding nameBinding = name.resolveBinding();
    // If this is a Field access, then add children to CFG
    if(nameBinding.getKind() == IBinding.VARIABLE) {
      IVariableBinding variableBinding = (IVariableBinding) nameBinding;
      if(variableBinding.isField()) {
        ControlFlowNode nameCFN = controlFlowNode.newControlFlowNode(name);
        ControlFlowNode qualifierCFN = controlFlowNode.newControlFlowNode(qualifier);
        controlFlowNode.moveEdges(ControlFlowNode.Direction.BACKWARDS, qualifierCFN);
View Full Code Here

          new EclipseSuperFieldAccess(target, eclipseVariableQuery),
          eclipseVariableQuery);
    }
    if(targetNode instanceof QualifiedName) {
      QualifiedName target = (QualifiedName) targetNode;
      IBinding binding = target.resolveBinding();
      if(binding instanceof IVariableBinding) {
        IVariableBinding vb = (IVariableBinding) binding;
        if(vb.isField()) {
          return new StoreFieldInstructionImpl(
              node,
              source,
              new EclipseBrokenFieldAccess(target, eclipseVariableQuery),
              eclipseVariableQuery);
        }
      }
    }
    if(targetNode instanceof SimpleName) {
      SimpleName target = (SimpleName) targetNode;
      IBinding binding = target.resolveBinding();
      if(binding instanceof IVariableBinding) {
        IVariableBinding vb = (IVariableBinding) binding;
        if(vb.isField()) {
          // implicit field access on this
          return new StoreFieldInstructionImpl(
View Full Code Here

  }

  public TACInstruction create(QualifiedName node,
      IEclipseVariableQuery eclipseVariableQuery) {
    // careful with the disambiguation of field accesses
    IBinding binding = node.resolveBinding();
    if(binding instanceof IVariableBinding) {
      // expect this to be a field
      IVariableBinding var = (IVariableBinding) binding;
      if(var.isField() || var.isEnumConstant()) {
        if(isLoad(node))
View Full Code Here

  }

  public TACInstruction create(SimpleName node,
      IEclipseVariableQuery eclipseVariableQuery) {
    // careful with the disambiguation of field accesses
    IBinding binding = node.resolveBinding();
    if(binding instanceof IVariableBinding) {
      IVariableBinding vb = (IVariableBinding) binding;
      if(vb.isField() || vb.isEnumConstant()) {
        if((node.getParent() instanceof QualifiedName) &&
            (((QualifiedName) node.getParent()).getName() == node))
View Full Code Here

      return variable(((ParenthesizedExpression) astNode).getExpression());
    }
   
    // maybe it's a variable
    if(astNode instanceof Name) {
      IBinding b = ((Name) astNode).resolveBinding();
      return getVariable(b);
    }
    if(astNode instanceof ThisExpression) {
      return getThisVariable((ThisExpression) astNode);
    }
View Full Code Here

   * @return the binding for the implicit <code>this</code>
   * variable of the given accessed element (method or field).
   */
  private ITypeBinding implicitThisBinding(IBinding accessedElement) {
    boolean isMethod;
    IBinding genericBinding; // generic version of accessedElement to simplify comparison
    if(accessedElement instanceof IMethodBinding) {
      if(((IMethodBinding) accessedElement).isConstructor())
        // constructor is easy because statically bound
        return ((IMethodBinding) accessedElement).getDeclaringClass();
      genericBinding = ((IMethodBinding) accessedElement).getMethodDeclaration();
View Full Code Here

      return variable(((ParenthesizedExpression) astNode).getExpression());
    }
   
    // maybe it's a variable
    if(astNode instanceof Name) {
      IBinding b = ((Name) astNode).resolveBinding();
      return getVariable(b);
    }
    if(astNode instanceof ThisExpression) {
      return getThisVariable((ThisExpression) astNode);
    }
View Full Code Here

TOP

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

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.