Class ReflectionUtil

java.lang.Object
org.javers.common.reflection.ReflectionUtil

public class ReflectionUtil extends Object
  • Constructor Details

    • ReflectionUtil

      public ReflectionUtil()
  • Method Details

    • isClassPresent

      public static boolean isClassPresent(String className)
    • classForName

      public static Class<?> classForName(String className)
      throws RuntimeException if class is not found
    • invokeGetter

      public static Object invokeGetter(Object target, String getterName)
    • newInstance

      public static Object newInstance(Class clazz, ArgumentResolver resolver)
      Creates new instance of public or package-private class. Calls first, not-private constructor
    • newInstance

      public static Object newInstance(Class clazz)
    • getAllPersistentFields

      public static List<JaversField> getAllPersistentFields(Class methodSource)
    • getAllGetters

      public static List<JaversGetter> getAllGetters(Class methodSource)
    • getAllFields

      public static List<JaversField> getAllFields(Class<?> methodSource)
    • getMirrorMember

      public static Optional<JaversMember> getMirrorMember(JaversMember member, Class methodSource)
    • getMirrorField

      public static Optional<JaversField> getMirrorField(JaversField field, Class methodSource)
    • getMirrorGetter

      public static Optional<JaversGetter> getMirrorGetter(JaversGetter getter, Class methodSource)
    • getAllTypeArguments

      public static List<Type> getAllTypeArguments(Type javaType)
      Makes sense for ParameterizedType
    • findClasses

      public static List<Class<?>> findClasses(Class<? extends Annotation> annotation, String... packages)
    • isConcreteType

      public static Optional<Type> isConcreteType(Type javaType)
    • extractClass

      public static Class extractClass(Type javaType)
      for example: Map<String, String> -> Map
    • isAnnotationPresentInHierarchy

      public static boolean isAnnotationPresentInHierarchy(Class<?> clazz, Class<? extends Annotation> ann)
    • getAllInterfaces

      public static List<Class<?>> getAllInterfaces(Class<?> clazz)
    • calculateHierarchyDistance

      public static List<Type> calculateHierarchyDistance(Class<?> clazz)
    • reflectiveToString

      public static String reflectiveToString(Object obj)
    • isAssignableFromAny

      public static boolean isAssignableFromAny(Class clazz, List<Class<?>> assignableFrom)
    • getAnnotationValue

      public static <T> T getAnnotationValue(Annotation ann, String propertyName)
    • looksLikeId

      public static boolean looksLikeId(Member member)
    • getAnnotations

      public static Set<Annotation> getAnnotations(Member member)