public class ReflectionUtil extends Object
| Constructor and Description |
|---|
ReflectionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static List<Method> |
getAllMethods(Class c,
Class<? extends Annotation> annotationType)
Returns a set of Methods that contain the given method annotation.
|
static void |
invokeAccessibly(Object instance,
Method method,
Object[] parameters)
Invokes a method using reflection, in an accessible manner (by using
AccessibleObject.setAccessible(boolean) |
static void |
setValue(Object instance,
String fieldName,
Object value) |
public static List<Method> getAllMethods(Class c, Class<? extends Annotation> annotationType)
c - class to inspectannotationType - the type of annotation to look forpublic static void invokeAccessibly(Object instance, Method method, Object[] parameters)
AccessibleObject.setAccessible(boolean)instance - instance on which to execute the methodmethod - method to executeparameters - parametersCopyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.