Top Description Methods
org.springframework.core.annotation

pack-priv Interface AnnotationsProcessor<C, R>

Known Direct Implementers
org.springframework.core.annotation.TypeMappedAnnotations.IsPresent, org.springframework.core.annotation.TypeMappedAnnotations.MergedAnnotationFinder, org.springframework.core.annotation.TypeMappedAnnotations.AggregatesCollector
Annotations
@FunctionalInterface
Type Parameters
<C>
the context type
<R>
the result type
Imports
java.lang.annotation.Annotation, org.springframework.lang.Nullable

Callback interface used to process annotations.
Author
Phillip Webb
Since
5.2
See Also
AnnotationsScanner, TypeMappedAnnotations

Method Summary

Modifier and TypeMethod and Description
public default R

Returns:

a non-null result if no further processing is required
doWithAggregate
(C
the context information relevant to the processor
context
,
int
the aggregate index about to be processed
aggregateIndex
)

Called when an aggregate is about to be processed.

public R

Returns:

a non-null result if no further processing is required
doWithAnnotations
(C
the context information relevant to the processor
context
,
int
the aggregate index of the provided annotations
aggregateIndex
,
Object
the original source of the annotations, if known
source
,
Annotation[]
the annotations to process (this array may contain null elements)
annotations
)

Called when an array of annotations can be processed.

public default R

Returns:

the final result to be returned to the caller
finish
(R
the last early exit result, or null if none
result
)

Get the final result to be returned.

Method Detail

doWithAggregateback to summary
public default R doWithAggregate(C context, int aggregateIndex)

Called when an aggregate is about to be processed. This method may return a non-null result to short-circuit any further processing.

Parameters
context:C

the context information relevant to the processor

aggregateIndex:int

the aggregate index about to be processed

Returns:R

a non-null result if no further processing is required

Annotations
@Nullable
doWithAnnotationsback to summary
public R doWithAnnotations(C context, int aggregateIndex, Object source, Annotation[] annotations)

Called when an array of annotations can be processed. This method may return a non-null result to short-circuit any further processing.

Parameters
context:C

the context information relevant to the processor

aggregateIndex:int

the aggregate index of the provided annotations

source:Object

the original source of the annotations, if known

annotations:Annotation[]

the annotations to process (this array may contain null elements)

Returns:R

a non-null result if no further processing is required

Annotations
@Nullable
finishback to summary
public default R finish(R result)

Get the final result to be returned. By default this method returns the last process result.

Parameters
result:R

the last early exit result, or null if none

Returns:R

the final result to be returned to the caller

Annotations
@Nullable