Package | Description |
---|---|
cn.hutool.core.annotation |
注解包,提供增强型注解和注解工具类
|
Modifier and Type | Interface and Description |
---|---|
interface |
WrappedAnnotationAttribute
表示一个被包装过的
AnnotationAttribute ,
该实例中的一些方法可能会被代理到另一个注解属性对象中,
从而使得通过原始的注解属性的方法获取到另一注解属性的值。 |
Modifier and Type | Class and Description |
---|---|
class |
AbstractWrappedAnnotationAttribute
|
class |
AliasedAnnotationAttribute
表示一个具有别名的属性。
|
class |
CacheableAnnotationAttribute
AnnotationAttribute 的基本实现 |
class |
ForceAliasedAnnotationAttribute
表示一个被指定了强制别名的注解属性。
|
class |
MirroredAnnotationAttribute
表示存在对应镜像属性的注解属性,当获取值时将根据
RelationType.MIRROR_FOR 的规则进行处理 |
Modifier and Type | Field and Description |
---|---|
protected AnnotationAttribute |
AbstractWrappedAnnotationAttribute.linked |
protected AnnotationAttribute |
AbstractWrappedAnnotationAttribute.original |
Modifier and Type | Method and Description |
---|---|
AnnotationAttribute |
WrappedAnnotationAttribute.getLinked()
|
AnnotationAttribute |
AbstractWrappedAnnotationAttribute.getLinked() |
AnnotationAttribute |
WrappedAnnotationAttribute.getNonWrappedOriginal()
获取最初的被包装的
AnnotationAttribute |
AnnotationAttribute |
AbstractWrappedAnnotationAttribute.getNonWrappedOriginal() |
AnnotationAttribute |
WrappedAnnotationAttribute.getOriginal()
获取被包装的
AnnotationAttribute 对象,该对象也可能是AnnotationAttribute |
AnnotationAttribute |
AbstractWrappedAnnotationAttribute.getOriginal() |
Modifier and Type | Method and Description |
---|---|
Collection<AnnotationAttribute> |
WrappedAnnotationAttribute.getAllLinkedNonWrappedAttributes()
遍历以当前实例为根节点的树结构,获取所有未被包装的属性
|
Collection<AnnotationAttribute> |
AbstractWrappedAnnotationAttribute.getAllLinkedNonWrappedAttributes() |
Map<String,AnnotationAttribute> |
SynthesizedAnnotation.getAttributes()
获取该注解的全部属性
|
Map<String,AnnotationAttribute> |
GenericSynthesizedAnnotation.getAttributes()
获取该注解的全部属性
|
protected Map<String,AnnotationAttribute> |
GenericSynthesizedAnnotation.loadAttributeMethods()
加载注解属性
|
Modifier and Type | Method and Description |
---|---|
protected void |
AbstractLinkAnnotationPostProcessor.checkAttributeType(AnnotationAttribute original,
AnnotationAttribute alias)
校验两个注解属性的返回值类型是否一致
|
protected void |
AbstractLinkAnnotationPostProcessor.checkLinkedAttributeNotNull(AnnotationAttribute original,
AnnotationAttribute linkedAttribute,
Link annotation)
检查
Link 指向的注解属性是否存在 |
protected void |
AbstractLinkAnnotationPostProcessor.checkLinkedSelf(AnnotationAttribute original,
AnnotationAttribute linked)
检查
Link 指向的注解属性是否就是本身 |
protected Link |
AbstractLinkAnnotationPostProcessor.getLinkAnnotation(AnnotationAttribute attribute,
RelationType... relationTypes)
从注解属性上获取指定类型的
Link 注解 |
protected void |
MirrorLinkAnnotationPostProcessor.processLinkedAttribute(AnnotationSynthesizer synthesizer,
Link annotation,
SynthesizedAnnotation originalAnnotation,
AnnotationAttribute originalAttribute,
SynthesizedAnnotation linkedAnnotation,
AnnotationAttribute linkedAttribute)
将存在镜像关系的合成注解属性分别包装为
MirroredAnnotationAttribute 对象,
并使用包装后MirroredAnnotationAttribute 替换在它们对应合成注解实例中的AnnotationAttribute |
protected void |
AliasLinkAnnotationPostProcessor.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 abstract void |
AbstractLinkAnnotationPostProcessor.processLinkedAttribute(AnnotationSynthesizer synthesizer,
Link annotation,
SynthesizedAnnotation originalAnnotation,
AnnotationAttribute originalAttribute,
SynthesizedAnnotation linkedAnnotation,
AnnotationAttribute linkedAttribute)
对关联的合成注解对象及其关联属性的处理
|
void |
SynthesizedAnnotation.setAttribute(String attributeName,
AnnotationAttribute attribute)
设置属性值
|
void |
GenericSynthesizedAnnotation.setAttribute(String attributeName,
AnnotationAttribute attribute)
设置属性值
|
Modifier and Type | Method and Description |
---|---|
void |
SynthesizedAnnotation.replaceAttribute(String attributeName,
UnaryOperator<AnnotationAttribute> operator)
替换属性值
|
void |
GenericSynthesizedAnnotation.replaceAttribute(String attributeName,
UnaryOperator<AnnotationAttribute> operator)
替换属性值
|
default void |
SynthesizedAnnotation.setAttributes(Map<String,AnnotationAttribute> attributes)
设置该注解的全部属性
|
Constructor and Description |
---|
AbstractWrappedAnnotationAttribute(AnnotationAttribute original,
AnnotationAttribute linked) |
AliasedAnnotationAttribute(AnnotationAttribute origin,
AnnotationAttribute linked) |
ForceAliasedAnnotationAttribute(AnnotationAttribute origin,
AnnotationAttribute linked) |
MirroredAnnotationAttribute(AnnotationAttribute origin,
AnnotationAttribute linked) |
Copyright © 2024. All rights reserved.