T
- 注解类型public interface AnnotationMapping<T extends Annotation> extends Annotation
AnnotationMappingProxy
Modifier and Type | Method and Description |
---|---|
default Class<? extends Annotation> |
annotationType()
获取注解类型
|
T |
getAnnotation()
获取注解对象
|
Method[] |
getAttributes()
获取注解原始属性
|
<R> R |
getAttributeValue(String attributeName,
Class<R> attributeType)
获取属性值
|
T |
getResolvedAnnotation()
根据当前映射对象,通过动态代理生成一个类型与被包装注解对象一致地合成注解,该注解相对原生注解:
支持同注解内通过
Alias 构建的别名机制;
支持子注解对元注解的同名同类型属性覆盖机制;
当isResolved() 为false 时,则该方法应当被包装的原始注解对象,
即返回值应当与getAnnotation() 相同。 |
<R> R |
getResolvedAttributeValue(String attributeName,
Class<R> attributeType)
获取解析后的属性值
|
boolean |
isResolved()
当前注解是否存在被解析的属性,当该值为
false 时,
通过getResolvedAttributeValue 获得的值皆为注解的原始属性值,
通过getResolvedAnnotation() 获得注解对象为原始的注解对象。 |
boolean |
isRoot()
当前注解是否为根注解
|
equals, hashCode, toString
boolean isRoot()
T getAnnotation()
T getResolvedAnnotation()
Alias
构建的别名机制;isResolved()
为false
时,则该方法应当被包装的原始注解对象,
即返回值应当与getAnnotation()
相同。isResolved()
为false
则返回的是原始的注解对象default Class<? extends Annotation> annotationType()
annotationType
in interface Annotation
boolean isResolved()
false
时,
通过getResolvedAttributeValue
获得的值皆为注解的原始属性值,
通过getResolvedAnnotation()
获得注解对象为原始的注解对象。Method[] getAttributes()
<R> R getAttributeValue(String attributeName, Class<R> attributeType)
R
- 返回值类型attributeName
- 属性名称attributeType
- 属性类型Copyright © 2025. All rights reserved.