Package com.aispect.common.util
Class ReflectionUtils
java.lang.Object
com.aispect.common.util.ReflectionUtils
Utility class that encapsulates reflection operations.
-
Method Summary
Modifier and TypeMethodDescriptionfindAnnotatedMethods(Class<?> clazz, Class<? extends Annotation> annotationClass) Find all methods in a class that are marked with a specific annotation.static ObjectinvokeMethod(Method method, Object target, Object... args) Safely execute methods reflectively.
-
Method Details
-
findAnnotatedMethods
public static List<Method> findAnnotatedMethods(Class<?> clazz, Class<? extends Annotation> annotationClass) Find all methods in a class that are marked with a specific annotation.- Parameters:
clazz- target classannotationClass- Annotation class- Returns:
- List of methods marked with this annotation
-
invokeMethod
public static Object invokeMethod(Method method, Object target, Object... args) throws AiSpectException Safely execute methods reflectively.- Parameters:
method- methodtarget- target audienceargs- Parameter list- Returns:
- Execution result
- Throws:
AiSpectException- Reflection execution exception
-