@Deprecated public final class Annotations extends Object
Provides helper methods to fetch annotations from a method or class, including its superclasses and interfaces.
Note: This class is deprecated and will be removed in version x.26. Use Jvm.findAnnotation(AnnotatedElement, Class) instead.
| Modifier and Type | Method and Description |
|---|---|
static <A extends Annotation> |
findAnnotation(Class<A> annoClass,
Class<?> aClass,
String name,
Class<?>[] parameterTypes)
Deprecated.
Finds the specified annotation on a method of a given class, its superclass, or interfaces.
|
static <A extends Annotation> |
getAnnotation(Method method,
Class<A> annotationClass)
Deprecated.
Fetches the specified annotation from a method.
|
public static <A extends Annotation> A findAnnotation(Class<A> annoClass, Class<?> aClass, String name, Class<?>[] parameterTypes)
A - the type of the annotation to be fetchedannoClass - the Class object corresponding to the annotation typeaClass - the Class object in which to find the methodname - the name of the methodparameterTypes - the parameter types of the methodA if present, or null otherwise@Nullable public static <A extends Annotation> A getAnnotation(Method method, Class<A> annotationClass)
A - the type of the annotation to be fetchedmethod - the method from which to fetch the annotationannotationClass - the Class object corresponding to the annotation typeA if present, or null otherwiseCopyright © 2023. All rights reserved.