public final class MessagingAnnotationUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.reflect.Method |
findAnnotatedMethod(java.lang.Object target,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType) |
static java.lang.annotation.Annotation |
findMessagePartAnnotation(java.lang.annotation.Annotation[] annotations,
boolean payloads)
Find the one of
Payload, Header or Headers annotation from
the provided annotations array. |
static boolean |
hasValue(java.lang.Object value) |
static <T> T |
resolveAttribute(java.util.List<java.lang.annotation.Annotation> annotations,
java.lang.String name,
java.lang.Class<T> requiredType)
Get the attribute value from the annotation hierarchy, returning the first non-empty
value closest to the annotated method.
|
public static <T> T resolveAttribute(java.util.List<java.lang.annotation.Annotation> annotations,
java.lang.String name,
java.lang.Class<T> requiredType)
T - The type.annotations - The meta-annotations in order (closest first).name - The attribute name.requiredType - The expected type.public static boolean hasValue(java.lang.Object value)
public static java.lang.reflect.Method findAnnotatedMethod(java.lang.Object target,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
public static java.lang.annotation.Annotation findMessagePartAnnotation(java.lang.annotation.Annotation[] annotations,
boolean payloads)
Payload, Header or Headers annotation from
the provided annotations array. Optionally also detects Payloads.annotations - the annotations to scan.payloads - true if @Payloads should be detected.null.org.springframework.messaging.MessagingException - if more than one of Payload, Header
or Headers annotations are presented.