public class MirrorLinkAnnotationPostProcessor extends AbstractLinkAnnotationPostProcessor
用于处理注解对象中带有Link
注解,且Link.type()
为RelationType.MIRROR_FOR
的属性。
当该处理器执行完毕后,原始合成注解中被Link
注解的属性与Link
注解指向的目标注解的属性,
都将会被被包装并替换为MirroredAnnotationAttribute
。
RelationType.MIRROR_FOR
,
MirroredAnnotationAttribute
ALIAS_ANNOTATION_POST_PROCESSOR, ALIAS_LINK_ANNOTATION_POST_PROCESSOR, MIRROR_LINK_ANNOTATION_POST_PROCESSOR
Constructor and Description |
---|
MirrorLinkAnnotationPostProcessor() |
Modifier and Type | Method and Description |
---|---|
int |
order()
在一组后置处理器中被调用的顺序,越小越靠前
|
protected void |
processLinkedAttribute(AnnotationSynthesizer synthesizer,
Link annotation,
SynthesizedAnnotation originalAnnotation,
AnnotationAttribute originalAttribute,
SynthesizedAnnotation linkedAnnotation,
AnnotationAttribute linkedAttribute)
将存在镜像关系的合成注解属性分别包装为
MirroredAnnotationAttribute 对象,
并使用包装后MirroredAnnotationAttribute 替换在它们对应合成注解实例中的AnnotationAttribute |
protected RelationType[] |
processTypes()
该处理器只处理
Link.type() 类型为RelationType.MIRROR_FOR 的注解属性 |
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()
Link.type()
类型为RelationType.MIRROR_FOR
的注解属性processTypes
in class AbstractLinkAnnotationPostProcessor
RelationType.MIRROR_FOR
数组protected void processLinkedAttribute(AnnotationSynthesizer synthesizer, Link annotation, SynthesizedAnnotation originalAnnotation, AnnotationAttribute originalAttribute, SynthesizedAnnotation linkedAnnotation, AnnotationAttribute linkedAttribute)
MirroredAnnotationAttribute
对象,
并使用包装后MirroredAnnotationAttribute
替换在它们对应合成注解实例中的AnnotationAttribute
processLinkedAttribute
in class AbstractLinkAnnotationPostProcessor
synthesizer
- 注解合成器annotation
- originalAttribute
上的Link
注解对象originalAnnotation
- 当前正在处理的SynthesizedAnnotation
对象originalAttribute
- originalAnnotation
上的待处理的属性linkedAnnotation
- Link
指向的关联注解对象linkedAttribute
- Link
指向的originalAnnotation
中的关联属性,该参数可能为空Copyright © 2024. All rights reserved.