接口 AnnotationsProcessor<C,R>

类型参数:
C - the context type
R - the result type
所有已知实现类:
TypeMappedAnnotations.AggregatesCollector, TypeMappedAnnotations.IsPresent, TypeMappedAnnotations.MergedAnnotationFinder
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface interface AnnotationsProcessor<C,R>
Callback interface used to process annotations.
从以下版本开始:
4.0
作者:
Phillip Webb
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    default R
    doWithAggregate(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 R
    finish(R result)
    Get the final result to be returned.
  • 方法详细资料

    • doWithAggregate

      @Nullable 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.
      参数:
      context - the context information relevant to the processor
      aggregateIndex - the aggregate index about to be processed
      返回:
      a non-null result 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 a non-null result to short-circuit any further processing.
      参数:
      context - the context information relevant to the processor
      aggregateIndex - the aggregate index of the provided annotations
      source - the original source of the annotations, if known
      annotations - the annotations to process (this array may contain null elements)
      返回:
      a non-null result if no further processing is required
    • finish

      @Nullable default R finish(@Nullable R result)
      Get the final result to be returned. By default this method returns the last process result.
      参数:
      result - the last early exit result, or null if none
      返回:
      the final result to be returned to the caller