类 AnnotationsScanner
java.lang.Object
cn.taketoday.core.annotation.AnnotationsScanner
Scanner to search for relevant annotations in the annotation hierarchy of an
AnnotatedElement.- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Sam Brannen, Harry Yang
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private static final Map<AnnotatedElement,Annotation[]> private static final Annotation[]private static final Method[] -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明(专用程序包) static voidprivate static <C> Method[]getBaseTypeMethods(C context, Class<?> baseType) (专用程序包) static <A extends Annotation>
AgetDeclaredAnnotation(AnnotatedElement source, Class<A> annotationType) (专用程序包) static Annotation[]getDeclaredAnnotations(AnnotatedElement source, boolean defensive) (专用程序包) static booleanhasPlainJavaAnnotationsOnly(Class<?> type) (专用程序包) static booleanhasPlainJavaAnnotationsOnly(Object annotatedElement) private static booleanhasSameGenericTypeParameters(Method rootMethod, Method candidateMethod, Class<?>[] rootParameterTypes) private static booleanhasSameParameterTypes(Method rootMethod, Method candidateMethod) private static booleanisIgnorable(Class<?> annotationType) (专用程序包) static booleanisKnownEmpty(AnnotatedElement source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass) private static booleanisOverride(Method rootMethod, Method candidateMethod) private static booleanisWithoutHierarchy(AnnotatedElement source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass) private static <C,R> R process(C context, AnnotatedElement source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, AnnotationsProcessor<C, R> processor) private static <C,R> R processClass(C context, Class<?> source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, AnnotationsProcessor<C, R> processor) private static <C,R> R processClassHierarchy(C context, int[] aggregateIndex, Class<?> source, AnnotationsProcessor<C, R> processor, boolean includeInterfaces, Predicate<Class<?>> searchEnclosingClass) private static <C,R> R processClassHierarchy(C context, Class<?> source, AnnotationsProcessor<C, R> processor, boolean includeInterfaces, Predicate<Class<?>> searchEnclosingClass) private static <C,R> R processClassInheritedAnnotations(C context, Class<?> source, MergedAnnotations.SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) private static <C,R> R processElement(C context, AnnotatedElement source, AnnotationsProcessor<C, R> processor) private static <C,R> R processMethod(C context, Method source, MergedAnnotations.SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) private static <C,R> R processMethodAnnotations(C context, int aggregateIndex, Method source, AnnotationsProcessor<C, R> processor) private static <C,R> R processMethodHierarchy(C context, int[] aggregateIndex, Class<?> sourceClass, AnnotationsProcessor<C, R> processor, Method rootMethod, boolean includeInterfaces) private static <C,R> R processMethodInheritedAnnotations(C context, Method source, AnnotationsProcessor<C, R> processor) (专用程序包) static <C,R> R scan(C context, AnnotatedElement source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, AnnotationsProcessor<C, R> processor) Scan the hierarchy of the specified element for relevant annotations and call the processor as required.
-
字段详细资料
-
NO_ANNOTATIONS
-
NO_METHODS
-
declaredAnnotationCache
-
baseTypeMethodsCache
-
-
构造器详细资料
-
AnnotationsScanner
private AnnotationsScanner()
-
-
方法详细资料
-
scan
@Nullable static <C,R> R scan(C context, AnnotatedElement source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, AnnotationsProcessor<C, R> processor) Scan the hierarchy of the specified element for relevant annotations and call the processor as required.- 参数:
context- an optional context object that will be passed back to the processorsource- the source element to scansearchStrategy- the search strategy to usesearchEnclosingClass- a predicate which evaluates totrueif a search should be performed on the enclosing class of the class supplied to the predicateprocessor- the processor that receives the annotations- 返回:
- the result of
AnnotationsProcessor.finish(Object)
-
process
@Nullable private static <C,R> R process(C context, AnnotatedElement source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, AnnotationsProcessor<C, R> processor) -
processClass
@Nullable private static <C,R> R processClass(C context, Class<?> source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, AnnotationsProcessor<C, R> processor) -
processClassInheritedAnnotations
@Nullable private static <C,R> R processClassInheritedAnnotations(C context, Class<?> source, MergedAnnotations.SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) -
processClassHierarchy
@Nullable private static <C,R> R processClassHierarchy(C context, Class<?> source, AnnotationsProcessor<C, R> processor, boolean includeInterfaces, Predicate<Class<?>> searchEnclosingClass) -
processClassHierarchy
@Nullable private static <C,R> R processClassHierarchy(C context, int[] aggregateIndex, Class<?> source, AnnotationsProcessor<C, R> processor, boolean includeInterfaces, Predicate<Class<?>> searchEnclosingClass) -
processMethod
@Nullable private static <C,R> R processMethod(C context, Method source, MergedAnnotations.SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) -
processMethodInheritedAnnotations
@Nullable private static <C,R> R processMethodInheritedAnnotations(C context, Method source, AnnotationsProcessor<C, R> processor) -
processMethodHierarchy
@Nullable private static <C,R> R processMethodHierarchy(C context, int[] aggregateIndex, Class<?> sourceClass, AnnotationsProcessor<C, R> processor, Method rootMethod, boolean includeInterfaces) -
getBaseTypeMethods
-
isOverride
-
hasSameParameterTypes
-
hasSameGenericTypeParameters
-
processMethodAnnotations
@Nullable private static <C,R> R processMethodAnnotations(C context, int aggregateIndex, Method source, AnnotationsProcessor<C, R> processor) -
processElement
@Nullable private static <C,R> R processElement(C context, AnnotatedElement source, AnnotationsProcessor<C, R> processor) -
getDeclaredAnnotation
@Nullable static <A extends Annotation> A getDeclaredAnnotation(AnnotatedElement source, Class<A> annotationType) -
getDeclaredAnnotations
-
isIgnorable
-
isKnownEmpty
static boolean isKnownEmpty(AnnotatedElement source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass) -
hasPlainJavaAnnotationsOnly
-
hasPlainJavaAnnotationsOnly
-
isWithoutHierarchy
private static boolean isWithoutHierarchy(AnnotatedElement source, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass) -
clearCache
static void clearCache()
-