Get a declared annotation

Trying to fetch by type a single annotation declared directly on a certain artifact can be done as shown in the following example:

Class<Melon> clazz = Melon.class;
Method methodEat = clazz.getDeclaredMethod("eat");
Ripe methodRipeAnnotation
= methodEat.getDeclaredAnnotation(Ripe.class);
..................Content has been hidden....................

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