public abstract class AnnotationUtils extends Object
AnnotationUtils| Constructor and Description |
|---|
AnnotationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <A extends Annotation> |
findAnnotations(Method method,
Class<A> annotationClass)
Find specified
Annotation type maps from Method |
static Map<String,Object> |
getAttributes(Annotation annotation,
boolean ignoreDefaultValue,
String... ignoreAttributeNames)
Get the
Annotation attributes |
static Map<String,Object> |
getAttributes(Annotation annotation,
org.springframework.core.env.PropertyResolver propertyResolver,
boolean ignoreDefaultValue,
String... ignoreAttributeNames)
Get the
Annotation attributes |
static <A extends Annotation> |
isPresent(Method method,
Class<A> annotationClass)
Is specified
Annotation present on Method's declaring class or parameters or itself. |
static String |
resolveInterfaceName(Reference reference,
Class<?> defaultInterfaceClass) |
static String |
resolveInterfaceName(Service service,
Class<?> defaultInterfaceClass) |
public static String resolveInterfaceName(Service service, Class<?> defaultInterfaceClass) throws IllegalStateException
IllegalStateExceptionpublic static String resolveInterfaceName(Reference reference, Class<?> defaultInterfaceClass) throws IllegalStateException
IllegalStateExceptionpublic static <A extends Annotation> boolean isPresent(Method method, 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 Annotation> Map<ElementType,List<A>> findAnnotations(Method method, 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 Map<String,Object> getAttributes(Annotation annotation, boolean ignoreDefaultValue, String... ignoreAttributeNames)
Annotation attributesannotation - specified AnnotationignoreDefaultValue - whether ignore default value or notignoreAttributeNames - the attribute names of annotation should be ignoredpublic static Map<String,Object> getAttributes(Annotation annotation, org.springframework.core.env.PropertyResolver propertyResolver, boolean ignoreDefaultValue, 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 © 2011–2020 The Apache Software Foundation. All rights reserved.