com.github.leeonky.util.AnnotationGetter Maven / Gradle / Ivy
The newest version!
package com.github.leeonky.util;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class AnnotationGetter {
private static AnnotationGetter annotationGetter = new AnnotationGetter();
public static AnnotationGetter getInstance() {
return annotationGetter;
}
public static void setAnnotationGetter(AnnotationGetter getter) {
annotationGetter = getter;
}
public A getAnnotation(Field field, Class annotationClass) {
return field.getAnnotation(annotationClass);
}
public A getAnnotation(Method method, Class annotationClass) {
return method.getAnnotation(annotationClass);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy