Package io.narayana.lra
Class AnnotationResolver
- java.lang.Object
-
- io.narayana.lra.AnnotationResolver
-
public class AnnotationResolver extends java.lang.ObjectAnnotation resolver that resolves annotation in a matter similar to JAX-RS/Jakarta REST definitions.
-
-
Constructor Summary
Constructors Constructor Description AnnotationResolver()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.reflect.Method method)Returns whether or not the queried annotation is present on the method.static <T extends java.lang.annotation.Annotation>
TresolveAnnotation(java.lang.Class<T> annotationClass, java.lang.reflect.Method method)Finds the annotation on the method with the following criteria: 1.
-
-
-
Method Detail
-
resolveAnnotation
public static <T extends java.lang.annotation.Annotation> T resolveAnnotation(java.lang.Class<T> annotationClass, java.lang.reflect.Method method)Finds the annotation on the method with the following criteria: 1. Find the annotation on method directly. If not present, 2. Find the annotation on the same method in the superclass (superclass hierarchy). If not present, 3. Find the annotation on the same method in the implemented interfaces (and interfaces implemented by its superclasses). If not found return null.- Type Parameters:
T- the actual type of the annotation- Parameters:
annotationClass- annotation to look formethod- method to scan- Returns:
- the found annotation object or null if not found
-
isAnnotationPresent
public static boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.reflect.Method method)Returns whether or not the queried annotation is present on the method.- Returns:
- true if the annotation is found, false otherwise
- See Also:
resolveAnnotation(java.lang.Class<T>, java.lang.reflect.Method)
-
-