public class AliasLinkAnnotationPostProcessor extends AbstractLinkAnnotationPostProcessor
用于处理注解对象中带有Link注解,且Link.type()为
RelationType.ALIAS_FOR或RelationType.FORCE_ALIAS_FOR的属性。
当该处理器执行完毕后,Link注解指向的目标注解的属性将会被包装并替换为
AliasedAnnotationAttribute或ForceAliasedAnnotationAttribute。
RelationType.ALIAS_FOR,
AliasedAnnotationAttribute,
RelationType.FORCE_ALIAS_FOR,
ForceAliasedAnnotationAttributeALIAS_ANNOTATION_POST_PROCESSOR, ALIAS_LINK_ANNOTATION_POST_PROCESSOR, MIRROR_LINK_ANNOTATION_POST_PROCESSOR| Constructor and Description |
|---|
AliasLinkAnnotationPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
int |
order()
在一组后置处理器中被调用的顺序,越小越靠前
|
protected void |
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 RelationType[] |
processTypes()
|
checkAttributeType, checkLinkedAttributeNotNull, checkLinkedSelf, getLinkAnnotation, getLinkedAnnotation, getLinkedAnnotationType, processclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompareTopublic int order()
SynthesizedAnnotationPostProcessorprotected RelationType[] processTypes()
processTypes in class AbstractLinkAnnotationPostProcessorRelationType.ALIAS_FOR和RelationType.FORCE_ALIAS_FOR的数组protected void 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,
然后用包装后注解属性在对应的合成注解中替换原始的目标注解属性processLinkedAttribute in class AbstractLinkAnnotationPostProcessorsynthesizer - 注解合成器annotation - originalAttribute上的Link注解对象originalAnnotation - 当前正在处理的SynthesizedAnnotation对象originalAttribute - originalAnnotation上的待处理的属性linkedAnnotation - Link指向的关联注解对象linkedAttribute - Link指向的originalAnnotation中的关联属性,该参数可能为空Copyright © 2025. All rights reserved.