public class AnnotationUtils extends Object
AnnotationUtils
Various utility methods dealing with annotations
Constructor and Description |
---|
AnnotationUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addAllFields(Class<? extends Annotation> annotationClass,
Class clazz,
List<Field> allFields)
Adds all fields with the specified Annotation of class clazz and its superclasses to allFields
|
static void |
addAllInterfaces(Class clazz,
List<Class> allInterfaces) |
static void |
addAllMethods(Class<? extends Annotation> annotationClass,
Class clazz,
List<Method> allMethods)
Adds all methods with the specified Annotation of class clazz and its superclasses to allFields
|
static <T extends Annotation> |
findAnnotation(Class<?> clazz,
Class<T> annotationClass)
Returns the annotation on the given class or the package of the class.
|
static <T extends Annotation> |
findAnnotations(Class<?> clazz,
Class<T> annotationClass)
Returns a list of the annotation on the given class or the package of the class.
|
static String |
resolvePropertyName(Method method)
Returns the property name for a method.
|
public static void addAllFields(Class<? extends Annotation> annotationClass, Class clazz, List<Field> allFields)
annotationClass
- the Annotation
s to findclazz
- The Class
to inspectallFields
- list of all fieldspublic static void addAllMethods(Class<? extends Annotation> annotationClass, Class clazz, List<Method> allMethods)
annotationClass
- the Annotation
s to findclazz
- The Class
to inspectallMethods
- list of all methodspublic static void addAllInterfaces(Class clazz, List<Class> allInterfaces)
clazz
- The Class
to inspectallInterfaces
- list of all interfacespublic static String resolvePropertyName(Method method)
method
- The method to get the property name for.public static <T extends Annotation> T findAnnotation(Class<?> clazz, Class<T> annotationClass)
T
- class typeclazz
- The class to search for the annotation.annotationClass
- The Class of the annotation.public static <T extends Annotation> List<T> findAnnotations(Class<?> clazz, Class<T> annotationClass)
T
- class typeclazz
- The class to search for the annotation.annotationClass
- The Class of the annotation.Copyright © 2000–2020 Apache Software Foundation. All rights reserved.