public abstract class AnnotationUtils
extends java.lang.Object
Annotation UtilitiesAnnotation| 构造器 | 说明 |
|---|---|
AnnotationUtils() |
| 修饰符和类型 | 方法 | 说明 |
|---|---|---|
static <A extends java.lang.annotation.Annotation> |
findAnnotations(java.lang.reflect.Method method,
java.lang.Class<A> annotationClass) |
Find specified
Annotation type maps from Method |
static java.util.Map<java.lang.String,java.lang.Object> |
getAttributes(java.lang.annotation.Annotation annotation,
boolean ignoreDefaultValue,
java.lang.String... ignoreAttributeNames) |
Get the
Annotation attributes |
static java.util.Map<java.lang.String,java.lang.Object> |
getAttributes(java.lang.annotation.Annotation annotation,
org.springframework.core.env.PropertyResolver propertyResolver,
boolean ignoreDefaultValue,
java.lang.String... ignoreAttributeNames) |
Get the
Annotation attributes |
static <A extends java.lang.annotation.Annotation> |
isPresent(java.lang.reflect.Method method,
java.lang.Class<A> annotationClass) |
Is specified
Annotation present on Method's declaring class or parameters or itself. |
public static <A extends java.lang.annotation.Annotation> boolean isPresent(java.lang.reflect.Method method,
java.lang.Class<A> annotationClass)
Annotation present on Method's declaring class or parameters or itself.A - Annotation typemethod - MethodannotationClass - Annotation typetrue , or falsepublic static <A extends java.lang.annotation.Annotation> java.util.Map<java.lang.annotation.ElementType,java.util.List<A>> findAnnotations(java.lang.reflect.Method method,
java.lang.Class<A> annotationClass)
Annotation type maps from MethodA - Annotation typemethod - MethodannotationClass - Annotation typeAnnotation type maps , the ElementType as key ,
the list of Annotation as value.
If Annotation was annotated on Method's parametersElementType.PARAMETER ,
the associated Annotation list may contain multiple elements.public static java.util.Map<java.lang.String,java.lang.Object> getAttributes(java.lang.annotation.Annotation annotation,
boolean ignoreDefaultValue,
java.lang.String... ignoreAttributeNames)
Annotation attributesannotation - specified AnnotationignoreDefaultValue - whether ignore default value or notignoreAttributeNames - the attribute names of annotation should be ignoredpublic static java.util.Map<java.lang.String,java.lang.Object> getAttributes(java.lang.annotation.Annotation annotation,
org.springframework.core.env.PropertyResolver propertyResolver,
boolean ignoreDefaultValue,
java.lang.String... ignoreAttributeNames)
Annotation attributesannotation - specified AnnotationpropertyResolver - PropertyResolver instance, e.g EnvironmentignoreDefaultValue - whether ignore default value or notignoreAttributeNames - the attribute names of annotation should be ignoredCopyright © 2018. All rights reserved.