R
- 根对象类型T
- 注解类型public class GenericSynthesizedAnnotation<R,T extends Annotation> extends Object implements SynthesizedAnnotation
Hierarchical.Selector
DEFAULT_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, wait
setAttributes
equals, hashCode, toString
compareTo
protected Map<String,AnnotationAttribute> loadAttributeMethods()
public boolean hasAttribute(String attributeName)
attributeName
- 属性名public boolean hasAttribute(String attributeName, Class<?> returnType)
hasAttribute
in interface SynthesizedAnnotation
attributeName
- 属性名returnType
- 返回值类型public Map<String,AnnotationAttribute> getAttributes()
getAttributes
in interface SynthesizedAnnotation
public void setAttribute(String attributeName, AnnotationAttribute attribute)
setAttribute
in interface SynthesizedAnnotation
attributeName
- 属性名称attribute
- 注解属性public void replaceAttribute(String attributeName, UnaryOperator<AnnotationAttribute> operator)
replaceAttribute
in interface SynthesizedAnnotation
attributeName
- 属性名operator
- 替换操作public Object getAttributeValue(String attributeName)
getAttributeValue
in interface SynthesizedAnnotation
attributeName
- 属性名public R getRoot()
getRoot
in interface Hierarchical
public T getAnnotation()
getAnnotation
in interface SynthesizedAnnotation
public int getVerticalDistance()
getVerticalDistance
in interface Hierarchical
getVerticalDistance
in interface SynthesizedAnnotation
public int getHorizontalDistance()
getHorizontalDistance
in interface Hierarchical
getHorizontalDistance
in interface SynthesizedAnnotation
public Class<? extends Annotation> annotationType()
annotationType
in interface Annotation
public Object getAttributeValue(String attributeName, Class<?> attributeType)
getAttributeValue
in interface AnnotationAttributeValueProvider
attributeName
- 属性名称attributeType
- 属性类型Copyright © 2024. All rights reserved.