Java has a native support for annotations.
I'm wondering if when I call obj.getAnnotation(Test.class)
, java stores class metadata in any kind of cache.
I have the same question with reflection like:
for (Method method : obj.getDeclaredMethods()) {
if (method.isAnnotationPresent(Test.class)) {
Annotation annotation = method.getAnnotation(Test.class);
Test test = (Test) annotation;
}
}