title: How can I call getter/setter for property marked with custom annotation?
body: <p>I am currently creating a custom marshalling tool for parsing an excel file. I would like to know how I can first find all properties with a custom annotation (this needs to take inheritance into account, so more than getDeclaredFields), then based on what method I am using call the corresponding getter or setter. Right now, I am just focusing on the setter. </p>
  
  <p>Current Code:</p>
  
  <pre><code>private &lt;T&gt; T findAnnotations(Class&lt;T&gt; clazz)
   {
      T obj  = null;
  
      Annotation[] annotations = clazz.getAnnotations();
  
      for(Annotation annotation : annotations)
      {
          if(annotation.annotationType() == ExcelColumn.class)
          {
              if(obj == null)
              {
                  try {
                      obj = clazz.newInstance();
                  } catch (IllegalAccessException | InstantiationException e) {
                  }
              }
              //annotation found
              //call setter of property
              //using ChildTest sample class call setname and set parent name 
              //with string previously parsed.
              // i.e obj.setName("") and obj.setParentName("") 
          }
      }
      return obj;
  }
  </code></pre>
  
  <p>Sample Class:</p>
  
  <pre><code>public class ChildTest extends Parent{
       @ExcelColumn
       private String name;
       public void setName(String name) {
            this.name = name;
       }
  }
  
  public class Parent{
       @ExcelColumn
       private String parentName;
       public void setParentName(String parentName) {
            this.parentName= parentName;
       }
   }
  </code></pre>