private abstract static class AnnotatedElementUtils.SimpleAnnotationProcessor<T> extends java.lang.Object implements AnnotatedElementUtils.Processor<T>
AnnotatedElementUtils.Processor
that processes annotations but does not post-process or
aggregate results.Modifier and Type | Field and Description |
---|---|
private boolean |
alwaysProcesses |
Constructor and Description |
---|
SimpleAnnotationProcessor() |
SimpleAnnotationProcessor(boolean alwaysProcesses) |
Modifier and Type | Method and Description |
---|---|
boolean |
aggregates()
Determine if this processor aggregates the results returned by
AnnotatedElementUtils.Processor.process(java.lang.reflect.AnnotatedElement, java.lang.annotation.Annotation, int) . |
boolean |
alwaysProcesses()
Determine if this processor always processes annotations regardless of
whether or not the target annotation has been found.
|
java.util.List<T> |
getAggregatedResults()
Get the list of results aggregated by this processor.
|
void |
postProcess(java.lang.reflect.AnnotatedElement annotatedElement,
java.lang.annotation.Annotation annotation,
T result)
Post-process the result returned by the
AnnotatedElementUtils.Processor.process(java.lang.reflect.AnnotatedElement, java.lang.annotation.Annotation, int) method. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
process
public SimpleAnnotationProcessor()
public SimpleAnnotationProcessor(boolean alwaysProcesses)
public final boolean alwaysProcesses()
AnnotatedElementUtils.Processor
alwaysProcesses
in interface AnnotatedElementUtils.Processor<T>
true
if this processor always processes annotationspublic final void postProcess(java.lang.reflect.AnnotatedElement annotatedElement, java.lang.annotation.Annotation annotation, T result)
AnnotatedElementUtils.Processor
AnnotatedElementUtils.Processor.process(java.lang.reflect.AnnotatedElement, java.lang.annotation.Annotation, int)
method.
The annotation
supplied to this method is an annotation
that is present in the annotation hierarchy, between the initial
AnnotatedElement
and an invocation of AnnotatedElementUtils.Processor.process(java.lang.reflect.AnnotatedElement, java.lang.annotation.Annotation, int)
that returned a non-null value.
postProcess
in interface AnnotatedElementUtils.Processor<T>
annotatedElement
- the element that is annotated with the
supplied annotation, used for contextual logging; may be
null
if unknownannotation
- the annotation to post-processresult
- the result to post-processpublic final boolean aggregates()
AnnotatedElementUtils.Processor
AnnotatedElementUtils.Processor.process(java.lang.reflect.AnnotatedElement, java.lang.annotation.Annotation, int)
.
If this method returns true
, then AnnotatedElementUtils.Processor.getAggregatedResults()
must return a non-null value.
aggregates
in interface AnnotatedElementUtils.Processor<T>
true
if this processor supports aggregated resultsAnnotatedElementUtils.Processor.getAggregatedResults()
public final java.util.List<T> getAggregatedResults()
AnnotatedElementUtils.Processor
NOTE: the processor does not aggregate the results
itself. Rather, the search algorithm that uses this processor is
responsible for asking this processor if it AnnotatedElementUtils.Processor.aggregates()
results
and then adding the post-processed results to the list returned by this
method.
getAggregatedResults
in interface AnnotatedElementUtils.Processor<T>
null
unless AnnotatedElementUtils.Processor.aggregates()
returns false
AnnotatedElementUtils.Processor.aggregates()