public class IndependentAnnotationEngine extends java.lang.Object implements AnnotationEngine, AnnotationEngine
Mock
or @Captor
.
The process(Class, Object)
method implementation does not process super classes!
MockitoAnnotations
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,FieldAnnotationProcessor<?>> |
annotationProcessorMap |
Constructor and Description |
---|
IndependentAnnotationEngine() |
Modifier and Type | Method and Description |
---|---|
private java.lang.Object |
createMockFor(java.lang.annotation.Annotation annotation,
java.lang.reflect.Field field) |
private <A extends java.lang.annotation.Annotation> |
forAnnotation(A annotation) |
void |
process(java.lang.Class<?> clazz,
java.lang.Object testInstance)
Processes the test instance to configure annotated members.
|
private <A extends java.lang.annotation.Annotation> |
registerAnnotationProcessor(java.lang.Class<A> annotationClass,
FieldAnnotationProcessor<A> fieldAnnotationProcessor) |
(package private) void |
throwIfAlreadyAssigned(java.lang.reflect.Field field,
boolean alreadyAssigned) |
private final java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,FieldAnnotationProcessor<?>> annotationProcessorMap
private java.lang.Object createMockFor(java.lang.annotation.Annotation annotation, java.lang.reflect.Field field)
private <A extends java.lang.annotation.Annotation> FieldAnnotationProcessor<A> forAnnotation(A annotation)
private <A extends java.lang.annotation.Annotation> void registerAnnotationProcessor(java.lang.Class<A> annotationClass, FieldAnnotationProcessor<A> fieldAnnotationProcessor)
public void process(java.lang.Class<?> clazz, java.lang.Object testInstance)
AnnotationEngine
process
in interface AnnotationEngine
clazz
- Class where to extract field information, check implementation for detailstestInstance
- Test instancevoid throwIfAlreadyAssigned(java.lang.reflect.Field field, boolean alreadyAssigned)