public class Reflections extends Object
| Constructor and Description |
|---|
Reflections() |
| Modifier and Type | Method and Description |
|---|---|
static Class |
classForName(String name) |
static String |
decapitalize(String name) |
static Object |
get(Field field,
Object target) |
static Object |
getAndWrap(Field field,
Object target) |
static Class<?> |
getClass(Type type)
Get the underlying class for a type, or null if the type is a variable type.
|
static Class |
getCollectionElementType(Type collectionType) |
static Field |
getField(Class clazz,
String name) |
static List<Field> |
getFields(Class clazz,
Class annotation) |
static Method |
getGetterMethod(Class clazz,
String name) |
static Class |
getMapKeyType(Type collectionType) |
static Method |
getMethod(Annotation annotation,
String name) |
static Method |
getMethod(Class clazz,
String name) |
static String |
getMethodPropertyName(String methodName) |
static List<Method> |
getMethods(Class clazz,
Class annotation) |
static Method |
getSetterMethod(Class clazz,
String name) |
static <T> List<Class<?>> |
getTypeArguments(Class<T> baseClass,
Class<? extends T> childClass)
Get the actual type arguments a child class has used to extend a generic base class.
|
static Object |
invoke(Method method,
Object target,
Object... args) |
static Object |
invokeAndWrap(Method method,
Object target,
Object... args) |
static boolean |
isClassAvailable(String name) |
static boolean |
isInstanceOf(Class clazz,
String name) |
static void |
set(Field field,
Object target,
Object value) |
static void |
setAndWrap(Field field,
Object target,
Object value) |
static String |
toClassNameString(String sep,
Object... objects) |
static String |
toString(Member member) |
static String |
unqualify(String name) |
static String |
unqualify(String name,
char sep) |
public static Object invoke(Method method, Object target, Object... args) throws Exception
Exceptionpublic static void set(Field field, Object target, Object value) throws Exception
Exceptionpublic static <T> List<Class<?>> getTypeArguments(Class<T> baseClass, Class<? extends T> childClass)
baseClass - the base classchildClass - the child classpublic static Class<?> getClass(Type type)
type - the typepublic static Class classForName(String name) throws ClassNotFoundException
ClassNotFoundExceptionpublic static boolean isClassAvailable(String name)
public static Method getMethod(Annotation annotation, String name)
Copyright © 2023 jUPnP.org. All rights reserved.