public abstract class ReflectUtil extends Object
| Constructor and Description |
|---|
ReflectUtil() |
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
fieldTypeCompatible(Object value,
Field field) |
protected static <T> Constructor<T> |
findMatchingConstructor(Class<T> clazz,
Object[] args) |
static ClassLoader |
getClassLoader() |
protected static ClassLoader |
getCustomClassLoader() |
static Field |
getField(String fieldName,
Class<?> clazz)
Returns the field of the given class or null if it doesn't exist.
|
static Field |
getField(String fieldName,
Object object)
Returns the field of the given object or null if it doesn't exist.
|
static String |
getGetterShorthandName(Method method) |
static URL |
getResource(String name) |
static InputStream |
getResourceAsStream(String name) |
static Method |
getSetter(String fieldName,
Class<?> clazz,
Class<?> fieldType)
Returns the setter-method for the given field name or null if no setter exists.
|
static String |
getSetterShorthandName(Method method) |
static Object |
instantiate(String className) |
static Object |
instantiate(String className,
Object[] args) |
static Object |
invoke(Object target,
String methodName,
Object[] args) |
static void |
invokeSetter(Method setterMethod,
Object target,
String name,
Object value) |
static void |
invokeSetterOrField(Object target,
String name,
Object value,
boolean throwExceptionOnMissingField) |
static boolean |
isGetter(Method method) |
static boolean |
isSetter(Method method) |
static boolean |
isSetter(Method method,
boolean allowBuilderPattern) |
protected static Class |
loadClass(ClassLoader classLoader,
String className) |
static Class<?> |
loadClass(String className) |
protected static boolean |
matches(Class<?>[] parameterTypes,
Object[] args) |
static void |
setField(Field field,
Object object,
Object value) |
public static ClassLoader getClassLoader()
public static InputStream getResourceAsStream(String name)
public static void invokeSetterOrField(Object target, String name, Object value, boolean throwExceptionOnMissingField)
public static Field getField(String fieldName, Object object)
public static Field getField(String fieldName, Class<?> clazz)
public static Method getSetter(String fieldName, Class<?> clazz, Class<?> fieldType)
public static void invokeSetter(Method setterMethod, Object target, String name, Object value)
protected static <T> Constructor<T> findMatchingConstructor(Class<T> clazz, Object[] args)
protected static ClassLoader getCustomClassLoader()
protected static Class loadClass(ClassLoader classLoader, String className) throws ClassNotFoundException
ClassNotFoundExceptionpublic static boolean isGetter(Method method)
public static boolean isSetter(Method method, boolean allowBuilderPattern)
public static boolean isSetter(Method method)
Copyright © 2021 Flowable. All rights reserved.