Explorar el Código

fix: AnnotationUtils - annotationType

Ranides Atterwim hace 2 años
padre
commit
d4a3bd2fe0

+ 6 - 1
assira.core/src/main/java/net/ranides/assira/reflection/util/AnnotationUtils.java

@@ -40,7 +40,9 @@ public final class AnnotationUtils {
     private static final Method HASHCODE = IClass.OBJECT.method("hashCode").get().reflective();
     
     private static final Method TOSTRING  = IClass.OBJECT.method("toString").get().reflective();
-    
+
+    private static final Method ANNOTATIONTYPE  = IClass.typeinfo(Annotation.class).method("annotationType").get().reflective();
+
     private static final CacheMap<Class<? extends Annotation>, Model> CACHE = CacheMap.getInstance(Model::new);
 
     /**
@@ -151,6 +153,9 @@ public final class AnnotationUtils {
             if(TOSTRING.equals(method)) {
                 return model.toString(proxy, map);
             }
+            if(ANNOTATIONTYPE.equals(method)) {
+                return model.type;
+            }
             return model.get(method.getName(), map);
         }