jeudi 8 octobre 2015

Using PropertyDescriptor - how do I get data members annotation?

Using BeanInfo I get a class property descriptor.
It describes a data member.

I want to get its annotation. Lets say I have

public Class Zoo{

   @A1
   private Dog dog;


   @A2
   public Dog getDog(){return dog;}
}

@A3
public class Dog{}

I can call

 propertyDescriptor.getReadMethod().getAnnotations()

and get @A2.

I can call

 propertyDescriptor.getPropertyType().getAnnotations()

and get @A3.

How do I get @A1?





Aucun commentaire:

Enregistrer un commentaire