Package it.tidalwave.messagebus.spi
Class ReflectionUtils
- java.lang.Object
-
- it.tidalwave.messagebus.spi.ReflectionUtils
-
public class ReflectionUtils extends java.lang.Object- Author:
- Fabrizio Giudici
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceReflectionUtils.MethodProcessorstatic classReflectionUtils.MethodProcessorSupport
-
Constructor Summary
Constructors Constructor Description ReflectionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontainsAnnotation(java.lang.annotation.Annotation[] annotations, java.lang.Class<?> annotationClass)Checks whether an array of annotations contains an annotation of the given type.static voidforEachMethodInBottomUpHierarchy(java.lang.Object object, ReflectionUtils.MethodProcessor processor)Navigates the hierarchy of the given object, bottom up, and applies theReflectionUtils.MethodProcessorto all the methods of each class, if not filtered out by the processor itself.static voidforEachMethodInTopDownHierarchy(java.lang.Object object, ReflectionUtils.MethodProcessor processor)Navigates the hierarchy of the given object, top down, and applies theReflectionUtils.MethodProcessorto all the methods of each class, if not filtered out by the processor itself.
-
-
-
Method Detail
-
forEachMethodInTopDownHierarchy
public static void forEachMethodInTopDownHierarchy(@Nonnull java.lang.Object object, @Nonnull ReflectionUtils.MethodProcessor processor)Navigates the hierarchy of the given object, top down, and applies theReflectionUtils.MethodProcessorto all the methods of each class, if not filtered out by the processor itself.- Parameters:
object- the object at the bottom of the hierarchyprocessor- the processor
-
forEachMethodInBottomUpHierarchy
public static void forEachMethodInBottomUpHierarchy(@Nonnull java.lang.Object object, @Nonnull ReflectionUtils.MethodProcessor processor)Navigates the hierarchy of the given object, bottom up, and applies theReflectionUtils.MethodProcessorto all the methods of each class, if not filtered out by the processor itself.- Parameters:
object- the object at the bottom of the hierarchyprocessor- the processor
-
containsAnnotation
public static boolean containsAnnotation(@Nonnull java.lang.annotation.Annotation[] annotations, @Nonnull java.lang.Class<?> annotationClass)Checks whether an array of annotations contains an annotation of the given type.- Parameters:
annotations- the annotations to checkannotationClass- the type of the required annotation- Returns:
- true if the annotation is found
-
-