cn.hutool.core.annotation.AliasFor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hutool-all Show documentation
Show all versions of hutool-all Show documentation
Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
package cn.hutool.core.annotation;
import java.lang.annotation.*;
/**
* {@link Link}的子注解。表示“原始属性”将作为“关联属性”的别名。
*
* - 当“原始属性”为默认值时,获取“关联属性”将返回“关联属性”本身的值;
* - 当“原始属性”不为默认值时,获取“关联属性”将返回“原始属性”的值;
*
* 注意,该注解与{@link Link}、{@link ForceAliasFor}或{@link MirrorFor}一起使用时,将只有被声明在最上面的注解会生效
*
* @author huangchengxing
* @see Link
* @see RelationType#ALIAS_FOR
*/
@Link(type = RelationType.ALIAS_FOR)
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
public @interface AliasFor {
/**
* 产生关联的注解类型,当不指定时,默认指注释的属性所在的类
*
* @return 注解类型
*/
@Link(annotation = Link.class, attribute = "annotation", type = RelationType.FORCE_ALIAS_FOR)
Class extends Annotation> annotation() default Annotation.class;
/**
* {@link #annotation()}指定注解中关联的属性
*
* @return 关联属性
*/
@Link(annotation = Link.class, attribute = "attribute", type = RelationType.FORCE_ALIAS_FOR)
String attribute() default "";
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy