接口 AnnotationsProcessor<C,R>
- 类型参数:
C- the context typeR- the result type
- 所有已知实现类:
TypeMappedAnnotations.AggregatesCollector,TypeMappedAnnotations.IsPresent,TypeMappedAnnotations.MergedAnnotationFinder
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
Callback interface used to process annotations.
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb
- 另请参阅:
-
方法概要
修饰符和类型方法说明default RdoWithAggregate(C context, int aggregateIndex) Called when an aggregate is about to be processed.doWithAnnotations(C context, int aggregateIndex, Object source, Annotation[] annotations) Called when an array of annotations can be processed.default RGet the final result to be returned.
-
方法详细资料
-
doWithAggregate
Called when an aggregate is about to be processed. This method may return anon-nullresult to short-circuit any further processing.- 参数:
context- the context information relevant to the processoraggregateIndex- the aggregate index about to be processed- 返回:
- a
non-nullresult if no further processing is required
-
doWithAnnotations
@Nullable R doWithAnnotations(C context, int aggregateIndex, @Nullable Object source, Annotation[] annotations) Called when an array of annotations can be processed. This method may return anon-nullresult to short-circuit any further processing.- 参数:
context- the 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 containnullelements)- 返回:
- a
non-nullresult if no further processing is required
-
finish
Get the final result to be returned. By default this method returns the last process result.- 参数:
result- the last early exit result, ornullif none- 返回:
- the final result to be returned to the caller
-