Package | Description |
---|---|
cn.hutool.core.annotation |
注解包,提供增强型注解和注解工具类
|
Modifier and Type | Class and Description |
---|---|
static class |
GenericSynthesizedAggregateAnnotation.MetaAnnotation
注解包装类,表示
AbstractAnnotationSynthesizer.source 以及AbstractAnnotationSynthesizer.source 所属层级结构中的全部关联注解对象 |
class |
GenericSynthesizedAnnotation<R,T extends Annotation>
|
Modifier and Type | Field and Description |
---|---|
protected Map<Class<? extends Annotation>,SynthesizedAnnotation> |
AbstractAnnotationSynthesizer.synthesizedAnnotationMap
包含根注解以及其元注解在内的全部注解实例
|
Modifier and Type | Method and Description |
---|---|
<T extends SynthesizedAnnotation> |
SynthesizedAnnotationSelector.choose(T oldAnnotation,
T newAnnotation)
比较两个被合成的注解,选择其中的一个并返回
|
<T extends SynthesizedAnnotation> |
SynthesizedAnnotationSelector.NearestAndOldestPrioritySelector.choose(T oldAnnotation,
T newAnnotation) |
<T extends SynthesizedAnnotation> |
SynthesizedAnnotationSelector.NearestAndNewestPrioritySelector.choose(T oldAnnotation,
T newAnnotation) |
<T extends SynthesizedAnnotation> |
SynthesizedAnnotationSelector.FarthestAndOldestPrioritySelector.choose(T oldAnnotation,
T newAnnotation) |
<T extends SynthesizedAnnotation> |
SynthesizedAnnotationSelector.FarthestAndNewestPrioritySelector.choose(T oldAnnotation,
T newAnnotation) |
Modifier and Type | Method and Description |
---|---|
protected SynthesizedAnnotation |
AbstractLinkAnnotationPostProcessor.getLinkedAnnotation(Link annotation,
AnnotationSynthesizer synthesizer,
Class<? extends Annotation> defaultType)
从合成注解中获取
Link.type() 指定的注解对象 |
SynthesizedAnnotation |
AnnotationSynthesizer.getSynthesizedAnnotation(Class<?> annotationType)
获取已合成的注解
|
SynthesizedAnnotation |
AbstractAnnotationSynthesizer.getSynthesizedAnnotation(Class<?> annotationType)
获取已合成的注解
|
Modifier and Type | Method and Description |
---|---|
Map<Class<? extends Annotation>,SynthesizedAnnotation> |
AnnotationSynthesizer.getAllSynthesizedAnnotation()
获取全部的合成注解
|
Map<Class<? extends Annotation>,SynthesizedAnnotation> |
AbstractAnnotationSynthesizer.getAllSynthesizedAnnotation()
获取全部的合成注解
|
protected Map<Class<? extends Annotation>,SynthesizedAnnotation> |
GenericSynthesizedAggregateAnnotation.loadAnnotations()
按广度优先扫描
AbstractAnnotationSynthesizer.source 上的元注解 |
protected abstract Map<Class<? extends Annotation>,SynthesizedAnnotation> |
AbstractAnnotationSynthesizer.loadAnnotations()
加载合成注解的必要属性
|
Modifier and Type | Method and Description |
---|---|
static <T extends Annotation> |
SynthesizedAnnotationProxy.create(Class<T> annotationType,
AnnotationAttributeValueProvider annotationAttributeValueProvider,
SynthesizedAnnotation annotation)
创建一个代理注解,生成的代理对象将是
SyntheticProxyAnnotation 与指定的注解类的子类。 |
static <T extends Annotation> |
SynthesizedAnnotationProxy.create(Class<T> annotationType,
SynthesizedAnnotation annotation)
创建一个代理注解,生成的代理对象将是
SyntheticProxyAnnotation 与指定的注解类的子类。 |
void |
SynthesizedAnnotationPostProcessor.process(SynthesizedAnnotation synthesizedAnnotation,
AnnotationSynthesizer synthesizer)
给定指定被合成注解与其所属的合成注解聚合器实例,经过处理后返回最终
|
void |
AliasAnnotationPostProcessor.process(SynthesizedAnnotation synthesizedAnnotation,
AnnotationSynthesizer synthesizer) |
void |
AbstractLinkAnnotationPostProcessor.process(SynthesizedAnnotation synthesizedAnnotation,
AnnotationSynthesizer synthesizer)
若一个注解属性上存在
Link 注解,注解的Link.type() 返回值在AbstractLinkAnnotationPostProcessor.processTypes() 中存在,
且此Link 指定的注解对象在当前的SynthesizedAggregateAnnotation 中存在,
则从聚合器中获取类型对应的合成注解对象,与该对象中的指定属性,然后将全部关联数据交给
AbstractLinkAnnotationPostProcessor.processLinkedAttribute(cn.hutool.core.annotation.AnnotationSynthesizer, cn.hutool.core.annotation.Link, cn.hutool.core.annotation.SynthesizedAnnotation, cn.hutool.core.annotation.AnnotationAttribute, cn.hutool.core.annotation.SynthesizedAnnotation, cn.hutool.core.annotation.AnnotationAttribute) 处理。 |
protected void |
MirrorLinkAnnotationPostProcessor.processLinkedAttribute(AnnotationSynthesizer synthesizer,
Link annotation,
SynthesizedAnnotation originalAnnotation,
AnnotationAttribute originalAttribute,
SynthesizedAnnotation linkedAnnotation,
AnnotationAttribute linkedAttribute)
将存在镜像关系的合成注解属性分别包装为
MirroredAnnotationAttribute 对象,
并使用包装后MirroredAnnotationAttribute 替换在它们对应合成注解实例中的AnnotationAttribute |
protected void |
AliasLinkAnnotationPostProcessor.processLinkedAttribute(AnnotationSynthesizer synthesizer,
Link annotation,
SynthesizedAnnotation originalAnnotation,
AnnotationAttribute originalAttribute,
SynthesizedAnnotation linkedAnnotation,
AnnotationAttribute linkedAttribute)
获取
Link 指向的目标注解属性,并根据Link.type() 的类型是
RelationType.ALIAS_FOR 或RelationType.FORCE_ALIAS_FOR
将目标注解属性包装为AliasedAnnotationAttribute 或ForceAliasedAnnotationAttribute ,
然后用包装后注解属性在对应的合成注解中替换原始的目标注解属性 |
protected abstract void |
AbstractLinkAnnotationPostProcessor.processLinkedAttribute(AnnotationSynthesizer synthesizer,
Link annotation,
SynthesizedAnnotation originalAnnotation,
AnnotationAttribute originalAttribute,
SynthesizedAnnotation linkedAnnotation,
AnnotationAttribute linkedAttribute)
对关联的合成注解对象及其关联属性的处理
|
protected abstract <A extends Annotation> |
AbstractAnnotationSynthesizer.synthesize(Class<A> annotationType,
SynthesizedAnnotation annotation)
根据指定的注解类型和对应注解对象,合成最终所需的合成注解
|
<T extends Annotation> |
GenericSynthesizedAggregateAnnotation.synthesize(Class<T> annotationType,
SynthesizedAnnotation annotation)
若合成注解在存在指定元注解,则使用动态代理生成一个对应的注解实例
|
Modifier and Type | Method and Description |
---|---|
<R> R |
SynthesizedAnnotationAttributeProcessor.getAttributeValue(String attributeName,
Class<R> attributeType,
Collection<? extends SynthesizedAnnotation> synthesizedAnnotations)
从一批被合成注解中,获取指定名称与类型的属性值
|
<T> T |
CacheableSynthesizedAnnotationAttributeProcessor.getAttributeValue(String attributeName,
Class<T> attributeType,
Collection<? extends SynthesizedAnnotation> synthesizedAnnotations) |
Copyright © 2024. All rights reserved.