public abstract class AbstractAnnotationSynthesizer<T> extends Object implements AnnotationSynthesizer
Modifier and Type | Field and Description |
---|---|
protected AnnotationScanner |
annotationScanner
注解扫描器
|
protected SynthesizedAnnotationSelector |
annotationSelector
合成注解选择器
|
protected Collection<SynthesizedAnnotationPostProcessor> |
postProcessors
合成注解属性处理器
|
protected T |
source
合成注解来源最初来源
|
protected Map<Class<? extends Annotation>,SynthesizedAnnotation> |
synthesizedAnnotationMap
包含根注解以及其元注解在内的全部注解实例
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractAnnotationSynthesizer(T source,
SynthesizedAnnotationSelector annotationSelector,
Collection<SynthesizedAnnotationPostProcessor> annotationPostProcessors,
AnnotationScanner annotationScanner)
构造一个注解合成器
|
Modifier and Type | Method and Description |
---|---|
Map<Class<? extends Annotation>,SynthesizedAnnotation> |
getAllSynthesizedAnnotation()
获取全部的合成注解
|
Collection<SynthesizedAnnotationPostProcessor> |
getAnnotationPostProcessors()
获取合成注解后置处理器
|
SynthesizedAnnotationSelector |
getAnnotationSelector()
合成注解选择器
|
T |
getSource()
获取合成注解来源最初来源
|
SynthesizedAnnotation |
getSynthesizedAnnotation(Class<?> annotationType)
获取已合成的注解
|
protected abstract Map<Class<? extends Annotation>,SynthesizedAnnotation> |
loadAnnotations()
加载合成注解的必要属性
|
<A extends Annotation> |
synthesize(Class<A> annotationType)
获取合成注解
|
protected abstract <A extends Annotation> |
synthesize(Class<A> annotationType,
SynthesizedAnnotation annotation)
根据指定的注解类型和对应注解对象,合成最终所需的合成注解
|
protected final T source
protected final Map<Class<? extends Annotation>,SynthesizedAnnotation> synthesizedAnnotationMap
protected final SynthesizedAnnotationSelector annotationSelector
protected final Collection<SynthesizedAnnotationPostProcessor> postProcessors
protected final AnnotationScanner annotationScanner
protected AbstractAnnotationSynthesizer(T source, SynthesizedAnnotationSelector annotationSelector, Collection<SynthesizedAnnotationPostProcessor> annotationPostProcessors, AnnotationScanner annotationScanner)
source
- 当前查找的注解对象annotationSelector
- 合成注解选择器annotationPostProcessors
- 注解后置处理器annotationScanner
- 注解扫描器,该扫描器需要支持扫描注解类protected abstract Map<Class<? extends Annotation>,SynthesizedAnnotation> loadAnnotations()
protected abstract <A extends Annotation> A synthesize(Class<A> annotationType, SynthesizedAnnotation annotation)
A
- 注解类型annotationType
- 注解类型annotation
- 合成注解对象public T getSource()
getSource
in interface AnnotationSynthesizer
public SynthesizedAnnotationSelector getAnnotationSelector()
getAnnotationSelector
in interface AnnotationSynthesizer
public Collection<SynthesizedAnnotationPostProcessor> getAnnotationPostProcessors()
getAnnotationPostProcessors
in interface AnnotationSynthesizer
public SynthesizedAnnotation getSynthesizedAnnotation(Class<?> annotationType)
getSynthesizedAnnotation
in interface AnnotationSynthesizer
annotationType
- 注解类型public Map<Class<? extends Annotation>,SynthesizedAnnotation> getAllSynthesizedAnnotation()
getAllSynthesizedAnnotation
in interface AnnotationSynthesizer
public <A extends Annotation> A synthesize(Class<A> annotationType)
synthesize
in interface AnnotationSynthesizer
A
- 注解类型annotationType
- 注解类型Copyright © 2024. All rights reserved.