private class TypeMappedAnnotations.MergedAnnotationFinder<A extends java.lang.annotation.Annotation> extends java.lang.Object implements AnnotationsProcessor<java.lang.Object,MergedAnnotation<A>>
AnnotationsProcessor
that finds a single MergedAnnotation
.Modifier and Type | Field and Description |
---|---|
private java.util.function.Predicate<? super MergedAnnotation<A>> |
predicate |
private java.lang.Object |
requiredType |
private MergedAnnotation<A> |
result |
private MergedAnnotationSelector<A> |
selector |
Constructor and Description |
---|
MergedAnnotationFinder(java.lang.Object requiredType,
java.util.function.Predicate<? super MergedAnnotation<A>> predicate,
MergedAnnotationSelector<A> selector) |
Modifier and Type | Method and Description |
---|---|
MergedAnnotation<A> |
doWithAggregate(java.lang.Object context,
int aggregateIndex)
Called when an aggregate is about to be processed.
|
MergedAnnotation<A> |
doWithAnnotations(java.lang.Object type,
int aggregateIndex,
java.lang.Object source,
java.lang.annotation.Annotation[] annotations)
Called when an array of annotations can be processed.
|
MergedAnnotation<A> |
finish(MergedAnnotation<A> result)
Get the final result to be returned.
|
private MergedAnnotation<A> |
process(java.lang.Object type,
int aggregateIndex,
java.lang.Object source,
java.lang.annotation.Annotation annotation) |
private void |
updateLastResult(MergedAnnotation<A> candidate) |
private final java.lang.Object requiredType
@Nullable private final java.util.function.Predicate<? super MergedAnnotation<A extends java.lang.annotation.Annotation>> predicate
private final MergedAnnotationSelector<A extends java.lang.annotation.Annotation> selector
@Nullable private MergedAnnotation<A extends java.lang.annotation.Annotation> result
MergedAnnotationFinder(java.lang.Object requiredType, @Nullable java.util.function.Predicate<? super MergedAnnotation<A>> predicate, @Nullable MergedAnnotationSelector<A> selector)
@Nullable public MergedAnnotation<A> doWithAggregate(java.lang.Object context, int aggregateIndex)
AnnotationsProcessor
non-null
result to short-circuit any further processing.doWithAggregate
in interface AnnotationsProcessor<java.lang.Object,MergedAnnotation<A extends java.lang.annotation.Annotation>>
context
- context information relevant to the processoraggregateIndex
- the aggregate index about to be processednon-null
result if no further processing is required@Nullable public MergedAnnotation<A> doWithAnnotations(java.lang.Object type, int aggregateIndex, @Nullable java.lang.Object source, java.lang.annotation.Annotation[] annotations)
AnnotationsProcessor
non-null
result to short-circuit any further processing.doWithAnnotations
in interface AnnotationsProcessor<java.lang.Object,MergedAnnotation<A extends java.lang.annotation.Annotation>>
type
- context information relevant to the processoraggregateIndex
- the aggregate index of the provided annotationssource
- the original source of the annotations, if knownannotations
- the annotations to process (this array may contain
null
elements)non-null
result if no further processing is required@Nullable private MergedAnnotation<A> process(java.lang.Object type, int aggregateIndex, @Nullable java.lang.Object source, java.lang.annotation.Annotation annotation)
private void updateLastResult(MergedAnnotation<A> candidate)
@Nullable public MergedAnnotation<A> finish(@Nullable MergedAnnotation<A> result)
AnnotationsProcessor
finish
in interface AnnotationsProcessor<java.lang.Object,MergedAnnotation<A extends java.lang.annotation.Annotation>>
result
- the last early exit result, or null
if none