Get annotations by type

Having multiple annotations of the same type on certain components, we can fetch all of them via getAnnotationsByType(). For a class, we can do it as follows:

Class<Melon> clazz = Melon.class;
Fruit[] clazzFruitAnnotations
= clazz.getAnnotationsByType(Fruit.class);
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.167.183