|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.util.AnnotationConfigLoader<A,CFG>
A - The annotation class used for configuring the resource on a test objectCFG - The type of the resource configuration classpublic abstract class AnnotationConfigLoader<A extends Annotation,CFG extends ResourceConfig>
Loads the configuration of a resource that is configured on a test object, by reading class, method or field level annotations. Also supports custom configuration methods.
| Field Summary | |
|---|---|
protected Class<A> |
annotationClass
The annotation class used for configuring the resource on a test object |
| Constructor Summary | |
|---|---|
AnnotationConfigLoader(Class<A> annotationClass)
Creates a new instance for the given annotation class |
|
| Method Summary | |
|---|---|
protected abstract CFG |
createResourceConfig(A configuringAnnotation,
Method customConfigMethod)
Either the given configuring annotation or custom config method must not be null (may also both be not-null) |
protected Method |
getCustomConfigMethod(Class<?> testClass)
|
protected CFG |
getResourceConfig(Class<?> testClass)
|
protected abstract boolean |
isConfiguringAnnotation(A annotation)
|
protected abstract boolean |
isCustomConfigMethod(Method annotatedMethod)
|
CFG |
loadResourceConfig(Object testObject)
Loads the resource configuration for the given test object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Class<A extends Annotation> annotationClass
| Constructor Detail |
|---|
public AnnotationConfigLoader(Class<A> annotationClass)
annotationClass - The class of the configuring annotation, not null| Method Detail |
|---|
public CFG loadResourceConfig(Object testObject)
loadResourceConfig in interface ResourceConfigLoader<CFG extends ResourceConfig>testObject - The test instance, not null
protected CFG getResourceConfig(Class<?> testClass)
testClass - The test class, not null
protected abstract CFG createResourceConfig(A configuringAnnotation,
Method customConfigMethod)
configuringAnnotation - Configuring annotation, if anycustomConfigMethod - Custom config method, if any
protected Method getCustomConfigMethod(Class<?> testClass)
testClass - The test class, not null
protected abstract boolean isCustomConfigMethod(Method annotatedMethod)
annotatedMethod - A method annotated with annotationClass
protected abstract boolean isConfiguringAnnotation(A annotation)
annotation - Annotation of type annotationClass
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||