public class AnnotationUtils extends Object
AnnotationUtils| Constructor and Description |
|---|
AnnotationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getAttribute(org.springframework.core.annotation.AnnotationAttributes attributes,
String name)
Get the attribute value
|
static Map<String,Object> |
getAttributes(Annotation annotation,
boolean ignoreDefaultValue,
String... ignoreAttributeNames)
Deprecated.
|
static Map<String,Object> |
getAttributes(Annotation annotation,
org.springframework.core.env.PropertyResolver propertyResolver,
boolean ignoreDefaultValue,
String... ignoreAttributeNames)
Get the
Annotation attributes |
static org.springframework.core.annotation.AnnotationAttributes |
getMergedAttributes(AnnotatedElement annotatedElement,
Class<? extends Annotation> annotationType,
org.springframework.core.env.PropertyResolver propertyResolver,
boolean ignoreDefaultValue,
String... ignoreAttributeNames)
Get
the annotation attributes after merging and resolving the placeholders |
static String |
resolveInterfaceName(org.springframework.core.annotation.AnnotationAttributes attributes,
Class<?> defaultInterfaceClass)
Resolve the interface name from
AnnotationAttributes |
static String |
resolveInterfaceName(Reference reference,
Class<?> defaultInterfaceClass)
Deprecated.
|
static String |
resolveInterfaceName(Service service,
Class<?> defaultInterfaceClass)
Deprecated.
|
static Map<String,Object> |
resolvePlaceholders(Map<String,Object> sourceAnnotationAttributes,
org.springframework.core.env.PropertyResolver propertyResolver,
String... ignoreAttributeNames)
Resolve the placeholders from the specified annotation attributes
|
static Class<?> |
resolveServiceInterfaceClass(org.springframework.core.annotation.AnnotationAttributes attributes,
Class<?> defaultInterfaceClass)
|
@Deprecated public static String resolveInterfaceName(Service service, Class<?> defaultInterfaceClass) throws IllegalStateException
IllegalStateExceptionpublic static String resolveInterfaceName(org.springframework.core.annotation.AnnotationAttributes attributes, Class<?> defaultInterfaceClass)
AnnotationAttributesattributes - AnnotationAttributes instance, may be @Service or @ReferencedefaultInterfaceClass - the default class of interfaceIllegalStateException - if interface name was not foundpublic static <T> T getAttribute(org.springframework.core.annotation.AnnotationAttributes attributes,
String name)
T - the type of attribute valueattributes - the annotation attributesname - the name of attributepublic static Class<?> resolveServiceInterfaceClass(org.springframework.core.annotation.AnnotationAttributes attributes, Class<?> defaultInterfaceClass) throws IllegalArgumentException
class of Dubbo Service interface from the specified
annotation attributes and annotated class.attributes - annotation attributesdefaultInterfaceClass - the annotated class.class of Dubbo Service interfaceIllegalArgumentException - if can't resolved@Deprecated public static String resolveInterfaceName(Reference reference, Class<?> defaultInterfaceClass) throws IllegalStateException
IllegalStateException@Deprecated 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 ignoredpublic static Map<String,Object> resolvePlaceholders(Map<String,Object> sourceAnnotationAttributes, org.springframework.core.env.PropertyResolver propertyResolver, String... ignoreAttributeNames)
sourceAnnotationAttributes - the source of annotation attributespropertyResolver - PropertyResolverignoreAttributeNames - the attribute names to be ignoredpublic static org.springframework.core.annotation.AnnotationAttributes getMergedAttributes(AnnotatedElement annotatedElement, Class<? extends Annotation> annotationType, org.springframework.core.env.PropertyResolver propertyResolver, boolean ignoreDefaultValue, String... ignoreAttributeNames)
the annotation attributes after merging and resolving the placeholdersannotatedElement - the annotated elementannotationType - the tyoe pf annotationpropertyResolver - PropertyResolver instance, e.g EnvironmentignoreDefaultValue - whether ignore default value or notignoreAttributeNames - the attribute names of annotation should be ignorednullCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.