title: how find fields of all member variables contained in java bean
body: <p>I want to make a GUI using Java in which a user can select a bean, edit its fields, and then add an instance of the created bean to a queue. My question though is about accessing the fields. I have a class MyCompositeObject that inherits from MyParentObject. The MyParentObject is composed of multiple beans, each being composed of more beans. The class MyCompositeObject is also composed of beans. I want to find all accessible fields from MyCompositeObject.</p>
  
  <pre><code>Class MyParentObject
  {
      MyObjectOne fieldOne;
      MyObjectTwo fieldTwo;
      String name;
    ...
   }
  
   Class MyCompositeObject extends MyParentObject
   {
      MyObjectThree fieldThree;
      Integer number;
     ...
   }
  
   Class MyObjectThree
   {
       boolean aBoolean;
       MyObjectFour fieldFour;
     ...
   }
  </code></pre>
  
  <p>I have been trying to use the BeanUtils api, but I'm getting stuck trying to get the fields of all the member beans. What I am imagining is a depth first search of all fields that could be accessed from an instance of MyCompositeObject. For example, this would include, but not be limited to, the fields: MyCompositeObject.fieldOne, MyCompositeObject.number, MyCompositeObject.fieldThree.aBoolean.</p>
  
  <p>I realized when I tried:</p>
  
  <pre><code>Fields[] allFields = BeanUtils.getFields(myCompositeObject);
  </code></pre>
  
  <p>that I was in over my head. My research has so far not turned up any prebuilt methods that could do what I describe. Please let me know of any API methods that can do this or tell me how I can go about building my own. Thanks.</p>