R - 根对象类型T - 注解类型public class GenericSynthesizedAnnotation<R,T extends Annotation> extends Object implements SynthesizedAnnotation
Hierarchical.SelectorDEFAULT_HIERARCHICAL_COMPARATOR| Modifier | Constructor and Description |
|---|---|
protected |
GenericSynthesizedAnnotation(R root,
T annotation,
int verticalDistance,
int horizontalDistance)
创建一个合成注解
|
| Modifier and Type | Method and Description |
|---|---|
Class<? extends Annotation> |
annotationType()
获取被合成的注解类型
|
T |
getAnnotation()
获取被合成的注解对象
|
Map<String,AnnotationAttribute> |
getAttributes()
获取该注解的全部属性
|
Object |
getAttributeValue(String attributeName)
获取属性值
|
Object |
getAttributeValue(String attributeName,
Class<?> attributeType)
获取注解属性值
|
int |
getHorizontalDistance()
获取该合成注解与根对象的水平距离。
|
R |
getRoot()
获取该合成注解对应的根节点
|
int |
getVerticalDistance()
获取该合成注解与根对象的垂直距离。
|
boolean |
hasAttribute(String attributeName)
元注解是否存在该属性
|
boolean |
hasAttribute(String attributeName,
Class<?> returnType)
元注解是否存在该属性,且该属性的值类型是指定类型或其子类
|
protected Map<String,AnnotationAttribute> |
loadAttributeMethods()
加载注解属性
|
void |
replaceAttribute(String attributeName,
UnaryOperator<AnnotationAttribute> operator)
替换属性值
|
void |
setAttribute(String attributeName,
AnnotationAttribute attribute)
设置属性值
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetAttributesequals, hashCode, toStringcompareToprotected Map<String,AnnotationAttribute> loadAttributeMethods()
public boolean hasAttribute(String attributeName)
attributeName - 属性名public boolean hasAttribute(String attributeName, Class<?> returnType)
hasAttribute in interface SynthesizedAnnotationattributeName - 属性名returnType - 返回值类型public Map<String,AnnotationAttribute> getAttributes()
getAttributes in interface SynthesizedAnnotationpublic void setAttribute(String attributeName, AnnotationAttribute attribute)
setAttribute in interface SynthesizedAnnotationattributeName - 属性名称attribute - 注解属性public void replaceAttribute(String attributeName, UnaryOperator<AnnotationAttribute> operator)
replaceAttribute in interface SynthesizedAnnotationattributeName - 属性名operator - 替换操作public Object getAttributeValue(String attributeName)
getAttributeValue in interface SynthesizedAnnotationattributeName - 属性名public R getRoot()
getRoot in interface Hierarchicalpublic T getAnnotation()
getAnnotation in interface SynthesizedAnnotationpublic int getVerticalDistance()
getVerticalDistance in interface HierarchicalgetVerticalDistance in interface SynthesizedAnnotationpublic int getHorizontalDistance()
getHorizontalDistance in interface HierarchicalgetHorizontalDistance in interface SynthesizedAnnotationpublic Class<? extends Annotation> annotationType()
annotationType in interface Annotationpublic Object getAttributeValue(String attributeName, Class<?> attributeType)
getAttributeValue in interface AnnotationAttributeValueProviderattributeName - 属性名称attributeType - 属性类型Copyright © 2025. All rights reserved.