Class CombinationAnnotatedElement
java.lang.Object
org.miaixz.bus.core.annotation.resolve.elements.CombinationAnnotatedElement
- All Implemented Interfaces:
Serializable,AnnotatedElement
组合注解 对JDK的原生注解机制做一个增强,支持类似Spring的组合注解。
核心实现使用了递归获取指定元素上的注解以及注解的注解,以实现复合注解的获取。
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
ConstructorsConstructorDescription构造CombinationAnnotatedElement(AnnotatedElement element, Predicate<Annotation> predicate) 构造 -
Method Summary
Modifier and TypeMethodDescription<T extends Annotation>
TgetAnnotation(Class<T> annotationClass) booleanisAnnotationPresent(Class<? extends Annotation> annotationClass) static CombinationAnnotatedElementof(AnnotatedElement element, Predicate<Annotation> predicate) 创建CombinationAnnotationElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.reflect.AnnotatedElement
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType
-
Constructor Details
-
CombinationAnnotatedElement
构造- Parameters:
element- 需要解析注解的元素:可以是Class、Method、Field、Constructor、ReflectPermission
-
CombinationAnnotatedElement
构造- Parameters:
element- 需要解析注解的元素:可以是Class、Method、Field、Constructor、ReflectPermissionpredicate- 过滤器,Predicate.test(Object)返回true保留,否则不保留
-
-
Method Details
-
of
public static CombinationAnnotatedElement of(AnnotatedElement element, Predicate<Annotation> predicate) 创建CombinationAnnotationElement- Parameters:
element- 需要解析注解的元素:可以是Class、Method、Field、Constructor、ReflectPermissionpredicate- 过滤器,Predicate.test(Object)返回true保留,否则不保留- Returns:
- CombinationAnnotationElement
-
isAnnotationPresent
- Specified by:
isAnnotationPresentin interfaceAnnotatedElement
-
getAnnotation
- Specified by:
getAnnotationin interfaceAnnotatedElement
-
getAnnotations
- Specified by:
getAnnotationsin interfaceAnnotatedElement
-
getDeclaredAnnotations
- Specified by:
getDeclaredAnnotationsin interfaceAnnotatedElement
-