public class ReflectionTools extends Object
This class has some reflection helpers.
| Constructor and Description |
|---|
ReflectionTools() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsMethod(Class<?> clazz,
String method,
Class<?>... parameterTypes)
Determines if the class given contains the method.
|
static <T extends Annotation> |
getAnnotation(Class<?> clazz,
String methodName,
Class<T> annotationClass)
Retrieves the annotation from the given method in the given class.
|
static List<Class<?>> |
getClassHierarchy(Class<?> clazz)
Return the list of parent classes in order (Object will be at index 0)
|
public static boolean containsMethod(Class<?> clazz, String method, Class<?>... parameterTypes)
clazz - The class to check for the method.method - The method name.parameterTypes - The parameter types of the method.public static <T extends Annotation> T getAnnotation(Class<?> clazz, String methodName, Class<T> annotationClass)
T - type of annotated classclazz - The class.methodName - The method.annotationClass - The annotation to get.Copyright © 2000–2025 Apache Software Foundation. All rights reserved.