public abstract class AbstractLinkAnnotationPostProcessor extends Object implements SynthesizedAnnotationPostProcessor
SynthesizedAnnotationPostProcessor
的基本实现,
用于处理注解中带有Link
注解的属性。MirrorLinkAnnotationPostProcessor
,
AliasLinkAnnotationPostProcessor
ALIAS_ANNOTATION_POST_PROCESSOR, ALIAS_LINK_ANNOTATION_POST_PROCESSOR, MIRROR_LINK_ANNOTATION_POST_PROCESSOR
Constructor and Description |
---|
AbstractLinkAnnotationPostProcessor() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compareTo, order
public void process(SynthesizedAnnotation synthesizedAnnotation, AnnotationSynthesizer synthesizer)
Link
注解,注解的Link.type()
返回值在processTypes()
中存在,
且此Link
指定的注解对象在当前的SynthesizedAggregateAnnotation
中存在,
则从聚合器中获取类型对应的合成注解对象,与该对象中的指定属性,然后将全部关联数据交给
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)
处理。process
in interface SynthesizedAnnotationPostProcessor
synthesizedAnnotation
- 合成的注解synthesizer
- 合成注解聚合器protected abstract RelationType[] processTypes()
Link
注解时,仅当Link.type()
在本方法返回值内存在时才进行处理RelationType
类型protected abstract void processLinkedAttribute(AnnotationSynthesizer synthesizer, Link annotation, SynthesizedAnnotation originalAnnotation, AnnotationAttribute originalAttribute, SynthesizedAnnotation linkedAnnotation, AnnotationAttribute linkedAttribute)
synthesizer
- 注解合成器annotation
- originalAttribute
上的Link
注解对象originalAnnotation
- 当前正在处理的SynthesizedAnnotation
对象originalAttribute
- originalAnnotation
上的待处理的属性linkedAnnotation
- Link
指向的关联注解对象linkedAttribute
- Link
指向的originalAnnotation
中的关联属性,该参数可能为空protected Link getLinkAnnotation(AnnotationAttribute attribute, RelationType... relationTypes)
Link
注解attribute
- 注解属性relationTypes
- 类型protected SynthesizedAnnotation getLinkedAnnotation(Link annotation, AnnotationSynthesizer synthesizer, Class<? extends Annotation> defaultType)
Link.type()
指定的注解对象annotation
- Link
注解synthesizer
- 注解合成器defaultType
- 默认类型SynthesizedAnnotation
protected Class<?> getLinkedAnnotationType(Link annotation, Class<?> defaultType)
annotation
- Link
注解defaultType
- 默认注解类型protected void checkAttributeType(AnnotationAttribute original, AnnotationAttribute alias)
original
- 原属性alias
- 别名属性protected void checkLinkedSelf(AnnotationAttribute original, AnnotationAttribute linked)
Link
指向的注解属性是否就是本身protected void checkLinkedAttributeNotNull(AnnotationAttribute original, AnnotationAttribute linkedAttribute, Link annotation)
Link
指向的注解属性是否存在Copyright © 2024. All rights reserved.