Class ReflectionUtils

java.lang.Object
net.engio.mbassy.common.ReflectionUtils

public class ReflectionUtils extends Object
Author:
bennidi Date: 2/16/12 Time: 12:14 PM
  • Constructor Details

    • ReflectionUtils

      public ReflectionUtils()
  • Method Details

    • getMethods

      public static Method[] getMethods(IPredicate<Method> condition, Class<?> target)
    • getMethods

      public static void getMethods(IPredicate<Method> condition, Class<?> target, ArrayList<Method> methods)
    • getOverridingMethod

      public static Method getOverridingMethod(Method overridingMethod, Class subclass)
      Traverses the class hierarchy upwards, starting at the given subclass, looking for an override of the given methods -> finds the bottom most override of the given method if any exists
      Parameters:
      overridingMethod -
      subclass -
    • getSuperTypes

      public static Class[] getSuperTypes(Class from)
      Collect all directly and indirectly related super types (classes and interfaces) of a given class.
      Parameters:
      from - The root class to start with
      Returns:
      A set of classes, each representing a super type of the root class
    • collectInterfaces

      public static void collectInterfaces(Class from, Collection<Class> accumulator)
    • containsOverridingMethod

      public static boolean containsOverridingMethod(Method[] allMethods, Method methodToCheck)
    • getAnnotation

      public static <A extends Annotation> A getAnnotation(AnnotatedElement from, Class<A> annotationType)