Class ReflectUtil

java.lang.Object
org.flowable.common.engine.impl.util.ReflectUtil

public abstract class ReflectUtil extends Object
Author:
Tom Baeyens
  • Constructor Details

    • ReflectUtil

      public ReflectUtil()
  • Method Details

    • getClassLoader

      public static ClassLoader getClassLoader()
    • loadClass

      public static Class<?> loadClass(String className)
    • getResourceAsStream

      public static InputStream getResourceAsStream(String name)
    • getResource

      public static URL getResource(String name)
    • instantiate

      public static Object instantiate(String className)
    • invoke

      public static Object invoke(Object target, String methodName, Object[] args)
    • 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.
    • setField

      public static void setField(Field field, Object object, Object value)
    • 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)
    • instantiate

      public static Object instantiate(String className, Object[] args)
    • findMatchingConstructor

      protected static <T> Constructor<T> findMatchingConstructor(Class<T> clazz, Object[] args)
    • matches

      protected static boolean matches(Class<?>[] parameterTypes, Object[] args)
    • fieldTypeCompatible

      protected static boolean fieldTypeCompatible(Object value, Field field)
    • 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)
    • getGetterShorthandName

      public static String getGetterShorthandName(Method method)
    • getSetterShorthandName

      public static String getSetterShorthandName(Method method)