@Documented @Retention(value=RUNTIME) @Target(value={METHOD,ANNOTATION_TYPE}) public @interface Link
用于在同一注解中,或具有一定关联的不同注解的属性中,表明这些属性之间具有特定的关联关系。
在通过SynthesizedAggregateAnnotation获取合成注解后,合成注解获取属性值时会根据该注解进行调整。
该注解存在三个字注解:MirrorFor、ForceAliasFor或AliasFor,
使用三个子注解等同于Link。但是需要注意的是,
当注解中的属性同时存在多个Link或基于Link的子注解时,
仅有声明在被注解的属性最上方的注解会生效,其余注解都将被忽略。
注意:该注解的优先级低于Alias
SynthesizedAggregateAnnotation,
RelationType,
AliasFor,
MirrorFor,
ForceAliasFor| Modifier and Type | Optional Element and Description |
|---|---|
Class<? extends Annotation> |
annotation
产生关联的注解类型,当不指定时,默认指注释的属性所在的类
|
String |
attribute
annotation()指定注解中关联的属性 |
RelationType |
type
attribute()指定属性与当前注解的属性建的关联关系类型 |
public abstract Class<? extends Annotation> annotation
public abstract String attribute
annotation()指定注解中关联的属性public abstract RelationType type
attribute()指定属性与当前注解的属性建的关联关系类型Copyright © 2025. All rights reserved.