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
,
ForceAliasedAnnotationAttribute
ALIAS_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, process
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compareTo
public int order()
SynthesizedAnnotationPostProcessor
protected RelationType[] processTypes()
processTypes
in class AbstractLinkAnnotationPostProcessor
RelationType.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 AbstractLinkAnnotationPostProcessor
synthesizer
- 注解合成器annotation
- originalAttribute
上的Link
注解对象originalAnnotation
- 当前正在处理的SynthesizedAnnotation
对象originalAttribute
- originalAnnotation
上的待处理的属性linkedAnnotation
- Link
指向的关联注解对象linkedAttribute
- Link
指向的originalAnnotation
中的关联属性,该参数可能为空Copyright © 2024. All rights reserved.