Class ReflectUtil
- java.lang.Object
-
- org.flowable.common.engine.impl.util.ReflectUtil
-
public abstract class ReflectUtil extends Object
- Author:
- Tom Baeyens
-
-
Constructor Summary
Constructors Constructor Description ReflectUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static booleanfieldTypeCompatible(Object value, Field field)protected static <T> Constructor<T>findMatchingConstructor(Class<T> clazz, Object[] args)static ClassLoadergetClassLoader()protected static ClassLoadergetCustomClassLoader()static FieldgetField(String fieldName, Class<?> clazz)Returns the field of the given class or null if it doesn't exist.static FieldgetField(String fieldName, Object object)Returns the field of the given object or null if it doesn't exist.static StringgetGetterShorthandName(Method method)static URLgetResource(String name)static InputStreamgetResourceAsStream(String name)static MethodgetSetter(String fieldName, Class<?> clazz, Class<?> fieldType)Returns the setter-method for the given field name or null if no setter exists.static StringgetSetterShorthandName(Method method)static Objectinstantiate(String className)static Objectinstantiate(String className, Object[] args)static Objectinvoke(Object target, String methodName, Object[] args)static voidinvokeSetter(Method setterMethod, Object target, String name, Object value)static voidinvokeSetterOrField(Object target, String name, Object value, boolean throwExceptionOnMissingField)static booleanisGetter(Method method)static booleanisSetter(Method method)static booleanisSetter(Method method, boolean allowBuilderPattern)protected static ClassloadClass(ClassLoader classLoader, String className)static Class<?>loadClass(String className)protected static booleanmatches(Class<?>[] parameterTypes, Object[] args)static voidsetField(Field field, Object object, Object value)
-
-
-
Method Detail
-
getClassLoader
public static ClassLoader getClassLoader()
-
getResourceAsStream
public static InputStream getResourceAsStream(String name)
-
invokeSetterOrField
public static void invokeSetterOrField(Object target, String name, Object value, boolean throwExceptionOnMissingField)
-
getField
public static Field getField(String fieldName, Object object)
Returns the field of the given object or null if it doesn't exist.
-
getField
public static Field getField(String fieldName, Class<?> clazz)
Returns the field of the given class or null if it doesn't exist.
-
getSetter
public static Method getSetter(String fieldName, Class<?> clazz, Class<?> fieldType)
Returns the setter-method for the given field name or null if no setter exists.
-
invokeSetter
public static void invokeSetter(Method setterMethod, Object target, String name, Object value)
-
findMatchingConstructor
protected static <T> Constructor<T> findMatchingConstructor(Class<T> clazz, Object[] args)
-
getCustomClassLoader
protected static ClassLoader getCustomClassLoader()
-
loadClass
protected static Class loadClass(ClassLoader classLoader, String className) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
isGetter
public static boolean isGetter(Method method)
-
isSetter
public static boolean isSetter(Method method, boolean allowBuilderPattern)
-
isSetter
public static boolean isSetter(Method method)
-
-