Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.SimpleName.resolveBinding()


    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


   * 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);
View Full Code Here

        }
      }
    }
    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

          SimpleType simpleType = (SimpleType) node;
          ITypeBinding typeBinding = simpleType.resolveBinding();
          checkNode(node, typeBinding);
        } else if (node instanceof SimpleName) {
          SimpleName simpleName = (SimpleName) node;
          if (simpleName.resolveBinding().getKind() == IBinding.TYPE
              && node.getLocationInParent() == MethodInvocation.EXPRESSION_PROPERTY) {
            ITypeBinding typeBinding = simpleName.resolveTypeBinding();
            checkNode(node, typeBinding);
          }
        }
View Full Code Here

    if (!isActive()) {
      return false;
    }

    SimpleName fieldName = node.getName();
    IVariableBinding fieldBinding = (IVariableBinding) fieldName
        .resolveBinding();
    if (fieldBinding != null) {
      ITypeBinding declaringTypeBinding = fieldBinding
          .getDeclaringClass();
      Expression expression = node.getExpression();
View Full Code Here

    return (((IVariableBinding) binding).getModifiers() & org.eclipse.jdt.core.dom.Modifier.FINAL) != 0;
  }

  public static IBinding getBinding(Name node) {
    SimpleName name = getPrefix(node);
    return name.resolveBinding();
  }

  public static ITypeBinding getTypeBinding(Name node) {
    SimpleName name = getPrefix(node);
    return name.resolveTypeBinding();
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.