title: Reflection Java - Get all fields of all declared class
body: <p>based on this question
  <a href="https://stackoverflow.com/questions/13685311/get-all-fields-of-class-hierarchy">Get all Fields of class hierarchy</a></p>
  
  <p>I have a similar question:</p>
  
  <p>i have class A and B:</p>
  
  <pre><code>class A {
    @SomeAnnotation
    long field1;
  
    B field2; //how can i access field of this class?
  
  }
  
  
  class B {
  
    @SomeAnnotation
    long field3;
  
  }
  </code></pre>
  
  <p>I want to get all fields values that have the annotation @SomeAnnotation from this 2 class.</p>
  
  <p>like:</p>
  
  <p>A.field1</p>
  
  <p>B.field3</p>