public final class ReflectionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Annotation |
getClassAnnotation(Class classToCheck,
Class annoClass)
Determine if the passed in class (classToCheck) has the annotation (annoClass) on itself,
any of its super classes, any of it's interfaces, or any of it's super interfaces.
|
static String |
getClassName(Object o)
Return the name of the class on the object, or "null" if the object is null.
|
static void |
getDeclaredFields(Class c,
Collection<Field> fields)
Get all non static, non transient, fields of the passed in class, including
private fields.
|
static Map<String,Field> |
getDeepDeclaredFieldMap(Class c)
Return all Fields from a class (including inherited), mapped by
String field name to java.lang.reflect.Field.
|
static Collection<Field> |
getDeepDeclaredFields(Class c)
Get all non static, non transient, fields of the passed in class, including
private fields.
|
static Method |
getMethod(Class c,
String method,
Class... types) |
static Annotation |
getMethodAnnotation(Method method,
Class annoClass) |
public static Annotation getClassAnnotation(Class classToCheck, Class annoClass)
public static Annotation getMethodAnnotation(Method method, Class annoClass)
public static Collection<Field> getDeepDeclaredFields(Class c)
c
- Class instancepublic static void getDeclaredFields(Class c, Collection<Field> fields)
c
- Class instance
that would need further processing (reference fields). This
makes field traversal on a class faster as it does not need to
continually process known fields like primitives.public static Map<String,Field> getDeepDeclaredFieldMap(Class c)
c
- Class whose fields are being fetched.Copyright © 2016. All rights reserved.