Package org.aoju.bus.core.scanner
Interface Synthetic
- All Superinterfaces:
AnnotatedElement,Annotation
- All Known Implementing Classes:
SyntheticMeta
表示基于特定规则聚合的一组注解对象
合成注解一般被用于处理类层级结果中具有直接或间接关联的注解对象, 当实例被创建时,会获取到这些注解对象,并使用SynthesizedSelector对类型相同的注解进行过滤,
并最终得到类型不重复的有效注解对象这些有效注解将被包装为Synthesized, 然后最终用于“合成”一个Synthesized
合成注解可以作为一个特殊的Annotation或者AnnotatedElement, 当调用Annotation的方法时,应当返回当前实例本身的有效信息,
而当调用AnnotatedElement的方法时,应当返回用于合成该对象的相关注解的信息
合成注解允许通过syntheticAnnotation(Class)合成一个指定的注解对象, 该方法返回的注解对象可能是原始的注解对象,也有可能通过动态代理的方式生成,
该对象实例的属性不一定来自对象本身,而是来自于经过SynthesizedProcessor 处理后的、用于合成当前实例的全部关联注解的相关属性
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptiondefault Class<? extends Annotation> 获取当前的注解类型<T extends Annotation>
TgetAnnotation(Class<T> annotationType) 获取指定注解对象获取全部注解获取合成注解选择器getAttribute(String attributeName, Class<?> attributeType) 获取属性值获取合成注解属性处理器getSynthesizedAnnotation(Class<?> annotationType) 获取已合成的注解booleanisAnnotationPresent(Class<? extends Annotation> annotationType) 是否存在指定注解static <T extends Annotation>
Syntheticof(T rootAnnotation) 基于指定根注解,构建包括其元注解在内的合成注解<T extends Annotation>
TsyntheticAnnotation(Class<T> annotationType) 获取合成注解Methods inherited from interface java.lang.reflect.AnnotatedElement
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotations, getDeclaredAnnotationsByTypeMethods inherited from interface java.lang.annotation.Annotation
equals, hashCode, toString
-
Method Details
-
of
基于指定根注解,构建包括其元注解在内的合成注解- Type Parameters:
T- 注解类型- Parameters:
rootAnnotation- 根注解- Returns:
- 合成注解
-
getAnnotationSelector
-
getAttributeProcessor
-
getSynthesizedAnnotation
获取已合成的注解- Parameters:
annotationType- 注解类型- Returns:
- 已合成的注解
-
annotationType
获取当前的注解类型- Specified by:
annotationTypein interfaceAnnotation- Returns:
- 注解类型
-
getAnnotation
获取指定注解对象- Specified by:
getAnnotationin interfaceAnnotatedElement- Type Parameters:
T- 注解类型- Parameters:
annotationType- 注解类型- Returns:
- 注解对象
-
isAnnotationPresent
是否存在指定注解- Specified by:
isAnnotationPresentin interfaceAnnotatedElement- Parameters:
annotationType- 注解类型- Returns:
- 是否
-
getAnnotations
Annotation[] getAnnotations()获取全部注解- Specified by:
getAnnotationsin interfaceAnnotatedElement- Returns:
- 注解对象
-
syntheticAnnotation
获取合成注解- Type Parameters:
T- 注解类型- Parameters:
annotationType- 注解类型- Returns:
- 类型
-
getAttribute
-