public class ReflectionUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ReflectionUtil.ClassAction |
static interface |
ReflectionUtil.FieldAction |
static interface |
ReflectionUtil.FieldPredicate |
static interface |
ReflectionUtil.MethodAction |
| Constructor and Description |
|---|
ReflectionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static ReflectionUtil.FieldPredicate |
allFields() |
static Method |
findMethod(Class<?> testClass,
String methodName) |
static com.google.common.base.Optional<Method> |
findMethodTransitively(Class<?> clazz,
String methodName) |
static void |
forEachField(Object object,
Class<?> clazz,
ReflectionUtil.FieldPredicate predicate,
ReflectionUtil.FieldAction action)
Iterates over all fields of the given class and all its super classes
and calls action.act() for the fields that are annotated with the given annotation.
|
static void |
forEachMethod(Object object,
Class<?> clazz,
Class<? extends Annotation> annotation,
ReflectionUtil.MethodAction action)
Iterates over all methods of the given class and all its super classes
and calls action.act() for the methods that are annotated with the given annotation.
|
static void |
forEachSuperClass(Class<?> clazz,
ReflectionUtil.ClassAction action)
Iterates over all super classes of the given class (including the class itself)
and calls action.act() for these classes.
|
static ReflectionUtil.FieldPredicate |
hasAtLeastOneAnnotation(Class<? extends Annotation>... annotation) |
public static void forEachField(Object object, Class<?> clazz, ReflectionUtil.FieldPredicate predicate, ReflectionUtil.FieldAction action)
public static void forEachMethod(Object object, Class<?> clazz, Class<? extends Annotation> annotation, ReflectionUtil.MethodAction action)
public static void forEachSuperClass(Class<?> clazz, ReflectionUtil.ClassAction action)
public static ReflectionUtil.FieldPredicate hasAtLeastOneAnnotation(Class<? extends Annotation>... annotation)
public static ReflectionUtil.FieldPredicate allFields()
public static com.google.common.base.Optional<Method> findMethodTransitively(Class<?> clazz, String methodName)
Copyright © 2014 TNG Technology Consulting. All rights reserved.