public class AnnotationUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getAnnotationAttributeFrom(Class<?> klass,
Class<? extends Annotation> annotationClass,
String methodName)
|
static <T> List<T> |
getAnnotationAttributeFromHierarchy(Class<?> klass,
Class<? extends Annotation> annotationClass,
String methodName)
Looks for the
Annotation in the Class and invokes the Method in the whole hierarhcy until it reaches
Object. |
public static <T> T getAnnotationAttributeFrom(Class<?> klass, Class<? extends Annotation> annotationClass, String methodName)
Annotation in the Class and invokes the Method. It will return the result of the
invocation. If there Class is not annotated it will return the default value from the Annotation.T - the result of the invocationklass - the Class where to look for the annotationannotationClass - the Annotation class to look formethodName - the method name of the annotation to be calledIllegalStateException - if the method is not defined in the annotationpublic static <T> List<T> getAnnotationAttributeFromHierarchy(Class<?> klass, Class<? extends Annotation> annotationClass, String methodName)
Annotation in the Class and invokes the Method in the whole hierarhcy until it reaches
Object. It will return a List with the results of each invocation. If there Class is not annotated
it will return the default value from the Annotation.T - the result of the invocationklass - the Class where to look for the annotationannotationClass - the Annotation class to look formethodName - the method name of the annotation to be calledObject class.IllegalStateException - if the method is not defined in the annotationCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.