public class MirrorLinkAnnotationPostProcessor extends AbstractLinkAnnotationPostProcessor
用于处理注解对象中带有Link注解,且Link.type()为RelationType.MIRROR_FOR的属性。
当该处理器执行完毕后,原始合成注解中被Link注解的属性与Link注解指向的目标注解的属性,
都将会被被包装并替换为MirroredAnnotationAttribute。
RelationType.MIRROR_FOR,
MirroredAnnotationAttributeALIAS_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, processclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompareTopublic int order()
SynthesizedAnnotationPostProcessorprotected RelationType[] processTypes()
Link.type()类型为RelationType.MIRROR_FOR的注解属性processTypes in class AbstractLinkAnnotationPostProcessorRelationType.MIRROR_FOR数组protected void processLinkedAttribute(AnnotationSynthesizer synthesizer, Link annotation, SynthesizedAnnotation originalAnnotation, AnnotationAttribute originalAttribute, SynthesizedAnnotation linkedAnnotation, AnnotationAttribute linkedAttribute)
MirroredAnnotationAttribute对象,
并使用包装后MirroredAnnotationAttribute替换在它们对应合成注解实例中的AnnotationAttributeprocessLinkedAttribute in class AbstractLinkAnnotationPostProcessorsynthesizer - 注解合成器annotation - originalAttribute上的Link注解对象originalAnnotation - 当前正在处理的SynthesizedAnnotation对象originalAttribute - originalAnnotation上的待处理的属性linkedAnnotation - Link指向的关联注解对象linkedAttribute - Link指向的originalAnnotation中的关联属性,该参数可能为空Copyright © 2025. All rights reserved.