类 ReflectUtils

java.lang.Object
org.cattleframework.utils.reflect.ReflectUtils

public final class ReflectUtils extends Object
反射工具
作者:
orange
  • 方法详细资料

    • getField

      public static Field getField(Class<?> clazz, String fieldName)
    • getField

      public static Field getField(Class<?> clazz, String fieldName, boolean throwNotFound)
    • setFieldValue

      public static void setFieldValue(Object obj, Field field, Object value)
    • setFieldValue

      public static void setFieldValue(Object obj, String fieldName, Object value)
    • getClassType

      public static ClassType getClassType(Class<?> typeCls)
    • setEnumValue

      public static Object setEnumValue(Class<?> clazz, String value)
    • getMethod

      public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes)
    • findSetMethod

      public static Method findSetMethod(Class<?> clazz, String name)
    • invokeMethod

      public static Object invokeMethod(Method method, Object... args)
    • invokeObjectMethod

      public static Object invokeObjectMethod(Method method, Object target, Object... args)
    • getFieldValue

      public static Object getFieldValue(Object obj, String fieldName)
    • getFieldValue

      public static Object getFieldValue(Object obj, Field field)
    • getFields

      public static Set<Field> getFields(Class<?> clazz)
    • getAnnotation

      public static <A extends Annotation> A getAnnotation(Class<?> clazz, Class<A> annotationClass)