T - 注解类型public interface HierarchicalAnnotation<T extends Annotation> extends Annotation, Hierarchical, AnnotationAttributeValueProvider
表示一个处于AnnotatedElement层级结构中的注解对象,
该注解对象的属性以AnnotationAttribute的形式存在,
通过替换该对象可以使该实例返回与原始注解不一样的属性值。
AnnotationAttribute,
AnnotationAttributeValueProvider,
HierarchicalHORIZONTAL_INDEX_START_POINT, VERTICAL_INDEX_START_POINT| 限定符和类型 | 方法和说明 |
|---|---|
default Class<? extends Annotation> |
annotationType()
获取注解对象类型,该方法返回值应与
getAnnotation()返回注解对象的Annotation.annotationType()相同 |
Collection<AnnotationAttribute> |
getAllAttribute()
获取全部的注解射弩了
|
T |
getAnnotation()
获取注解对象
|
AnnotationAttribute |
getAttribute(String attributeName)
获取注解属性
|
default Object |
getAttributeValue(String attributeName,
Class<?> attributeType)
获取属性值
|
boolean |
hasAttribute(String attributeName,
Class<?> attributeType)
注解是否存在指定类型的属性
|
void |
replaceAttribute(String attributeName,
UnaryOperator<AnnotationAttribute> operator)
替换属性值
|
equals, hashCode, toStringgetHorizontalIndex, getRoot, getVerticalIndexT getAnnotation()
default Class<? extends Annotation> annotationType()
getAnnotation()返回注解对象的Annotation.annotationType()相同annotationType 在接口中 Annotationboolean hasAttribute(String attributeName, Class<?> attributeType)
attributeName - 属性名attributeType - 返回值类型AnnotationAttribute getAttribute(String attributeName)
attributeName - 注解属性Collection<AnnotationAttribute> getAllAttribute()
void replaceAttribute(String attributeName, UnaryOperator<AnnotationAttribute> operator)
attributeName - 属性名称operator - 替换操作default Object getAttributeValue(String attributeName, Class<?> attributeType)
getAttributeValue 在接口中 AnnotationAttributeValueProviderattributeName - 属性名称attributeType - 属性类型Copyright © 2022. All rights reserved.