public final class MessagingAnnotationUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
endpointIdValue(Method method)
Return the
EndpointId.value() property, if present. |
static Method |
findAnnotatedMethod(Object target,
Class<? extends Annotation> annotationType) |
static Annotation |
findMessagePartAnnotation(Annotation[] annotations,
boolean payloads)
|
static boolean |
hasValue(Object value) |
static <T> T |
resolveAttribute(List<Annotation> annotations,
String name,
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(List<Annotation> annotations, String name, 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(Object value)
public static Method findAnnotatedMethod(Object target, Class<? extends Annotation> annotationType)
public static Annotation findMessagePartAnnotation(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
.MessagingException
- if more than one of Payload
, Header
or Headers
annotations are presented.public static String endpointIdValue(Method method)
EndpointId.value()
property, if present.method
- the methods.