title: HowTo: Find all references to a Field in Java
body: <p>Let's say I have the following classes:</p>
  
  <pre><code>class A {
    static public String a;
  }
  
  class B {
    public function referToFieldInClassA() {
      System.out.println(A.a);
    }
  }
  </code></pre>
  
  <p>Is there anything in the Java reflection APIs to allow me to find all places where a particular field is referenced? What I'm looking for is a way to find out that (given the example) class B has a reference to A.a.</p>
  
  <p>I know I can get all the Fields in a Class via the reflection API. But now I want to find all references to that Field.</p>
  
  <p>Thanks.</p>