mardi 27 décembre 2016

Getting fields of a class from Element

I have created a custom annotation and used that in a class as follows:

@Reportable
public class CustomerModel extends BaseModel {
    public String CustomerName;
    public int orderCount;
}

In annotation processor I have all elements that have been annotated with @Reportable using the following code:

 Set<? extends javax.lang.model.element.Element> elements = 
roundEnv.getElementsAnnotatedWith(Reportable.class);

How can I get fields of that classes? I want to list all properties of CustomerModel





Aucun commentaire:

Enregistrer un commentaire