title: how to get all attributes of a class?
body: <p>I would like to get the names and values of all attributes of a class instance. That class can be any customized any class, and it can also have object lists, hashmap, tables etc., and can be extented from another class. Actually I mean I would like to get name and value of all attr of a class. so what I need to do should be kind of template. Is it possible? I have written that up to now. any suggestion would be appreciated. </p>
  
  <pre><code>    public static void getObjectIntoMap(Object obj) throws IllegalArgumentException, IllegalAccessException {
      Field[] field = obj.getClass().getDeclaredFields();
      Class&lt;?&gt; c = obj.getClass().getSuperclass();
      if(c != Object.class)
          getObjectIntoMap(c.getClass());
      System.out.println("SSS : "+field.length);
      for (Field f : field) {
          if(f.getType() == java.util.List.class){
              java.util.List&lt;Object&gt; ll = (java.util.List&lt;Object&gt;) f.get(obj);
              for (Object o : ll) {
                  Field[] ff = o.getClass().getDeclaredFields();
                  for (Field field2 : ff) {
                      print(field2.getName(), field2.get(o).toString());
                  }
              }
          }else if(f.getType() == Hashtable.class){
  
          }
          else if(f.getType() == HashMap.class){
  
          }else if(f.getType() == Object[].class){
  
          }   
          else{
              print(f.getName(), f.get(obj).toString());
          }
      }
  }
  </code></pre>