Java have a native support for annotations.
I'm wondering if when I call obj.getAnnotation(Annotation.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(Annotation.class)) {
Annotation annotation = method.getAnnotation(Annotation.class);
Test test = (Test) annotation;
}
}
Aucun commentaire:
Enregistrer un commentaire