public class AnnotationUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Class |
findConfiguredClass(Class<?> testClass)
Finds the first class in a class hierarchy that is annotated with
ArtifactClassLoaderRunnerConfig. |
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 annotationpublic static Class findConfiguredClass(Class<?> testClass)
ArtifactClassLoaderRunnerConfig.
Annotated class is searched by levels, in a Breadth-first search (BFS) way. Starting from the class received as a parameter,
first the class is checked and return if annotated. Otherwise interface directly implemented by the class will be added to
review and finally its super class.
Implemented interfaces have priority over class hierarchy as base classes can be imported from other modules with different
runner configurations.testClass - class of the test begin executed by the test runner.Copyright © 2003–2018 MuleSoft, Inc.. All rights reserved.