Example usage for org.eclipse.jdt.core.dom FieldAccess toString

List of usage examples for org.eclipse.jdt.core.dom FieldAccess toString

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom FieldAccess toString.

Prototype

@Override
public final String toString() 

Source Link

Document

Returns a string representation of this node suitable for debugging purposes only.

Usage

From source file:ca.mcgill.cs.swevo.jayfx.ASTCrawler.java

License:Open Source License

@Override
public boolean visit(final FieldAccess pNode) {
    final IVariableBinding lBinding = (IVariableBinding) pNode.getName().resolveBinding();

    if (lBinding == null) {
        ASTCrawler.log("Null binding 1 for " + pNode.toString());
        return false;
    }//from w w  w. j a v a 2 s .  c  om

    this.addAccessRelation(lBinding);
    final Assignment assignment = ASTCrawler.getAssignment(pNode);
    if (assignment != null) {
        this.addSetsRelation(lBinding);

        if (!(assignment.getOperator() == Assignment.Operator.ASSIGN))
            this.addGetsRelation(lBinding);
    } else
        this.addGetsRelation(lBinding);
    return true;
}

From source file:jayfx.ASTCrawler.java

License:Open Source License

public boolean visit(FieldAccess pNode) {
    IVariableBinding lBinding = (IVariableBinding) pNode.getName().resolveBinding();
    //System.out.println(lBinding.getType().getName()); 

    if (lBinding == null) {
        log("Null binding 1 for " + pNode.toString());
        return false;
    }/*from  ww  w .j  a v  a 2  s. c o  m*/
    boolean flag = true;
    if (pNode != null) {

        ASTNode node = pNode;
        while (node.getNodeType() == 22 || node.getNodeType() == 42) {
            node = node.getParent();
        }
        if (node.getNodeType() == 7) {
            Assignment assign = (Assignment) node;
            if (assign != null) {
                Operator opera = (Operator) assign.getOperator();
                if (opera.equals(Operator.ASSIGN)) {
                    //Expression expr= (Expression)assign.getLeftHandSide();
                    //if(expr.equals(node)){

                    addfsetRelation((IVariableBinding) lBinding);
                    flag = false;
                    //}
                }
            }
        }

    }

    addAccessRelation(lBinding);
    return true;
}