类 StandardMethodMetadata
- java.lang.Object
- org.springframework.core.type.StandardMethodMetadata
- 所有已实现的接口:
AnnotatedTypeMetadata
,MethodMetadata
public class StandardMethodMetadata extends Object implements MethodMetadata
MethodMetadata
implementation that uses standard reflection to introspect a givenMethod
.- 从以下版本开始:
- 3.0
- 作者:
- Juergen Hoeller, Mark Pollack, Chris Beams, Phillip Webb
构造器概要
构造器 构造器 说明 StandardMethodMetadata(Method introspectedMethod)
Create a new StandardMethodMetadata wrapper for the given Method.StandardMethodMetadata(Method introspectedMethod, boolean nestedAnnotationsAsMap)
Create a new StandardMethodMetadata wrapper for the given Method, providing the option to return any nested annotations or annotation arrays in the form ofAnnotationAttributes
instead of actualAnnotation
instances.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 MultiValueMap<String,Object>
getAllAnnotationAttributes(String annotationName)
Retrieve all attributes of all annotations of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation).MultiValueMap<String,Object>
getAllAnnotationAttributes(String annotationName, boolean classValuesAsString)
Retrieve all attributes of all annotations of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation).Map<String,Object>
getAnnotationAttributes(String annotationName)
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation), also taking attribute overrides on composed annotations into account.Map<String,Object>
getAnnotationAttributes(String annotationName, boolean classValuesAsString)
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation), also taking attribute overrides on composed annotations into account.String
getDeclaringClassName()
Return the fully-qualified name of the class that declares this method.Method
getIntrospectedMethod()
Return the underlying Method.String
getMethodName()
Return the name of the method.String
getReturnTypeName()
Return the fully-qualified name of this method's declared return type.boolean
isAbstract()
Return whether the underlying method is effectively abstract: i.e. marked as abstract on a class or declared as a regular, non-default method in an interface.boolean
isAnnotated(String annotationName)
Determine whether the underlying element has an annotation or meta-annotation of the given type defined.boolean
isFinal()
Return whether the underlying method is marked as 'final'.boolean
isOverridable()
Return whether the underlying method is overridable, i.e. not marked as static, final or private.boolean
isStatic()
Return whether the underlying method is declared as 'static'.
构造器详细资料
StandardMethodMetadata
public StandardMethodMetadata(Method introspectedMethod)
Create a new StandardMethodMetadata wrapper for the given Method.- 参数:
introspectedMethod
- the Method to introspect
StandardMethodMetadata
public StandardMethodMetadata(Method introspectedMethod, boolean nestedAnnotationsAsMap)
Create a new StandardMethodMetadata wrapper for the given Method, providing the option to return any nested annotations or annotation arrays in the form ofAnnotationAttributes
instead of actualAnnotation
instances.- 参数:
introspectedMethod
- the Method to introspectnestedAnnotationsAsMap
- return nested annotations and annotation arrays asAnnotationAttributes
for compatibility with ASM-basedAnnotationMetadata
implementations- 从以下版本开始:
- 3.1.1
方法详细资料
getIntrospectedMethod
public final Method getIntrospectedMethod()
Return the underlying Method.
getMethodName
public String getMethodName()
从接口复制的说明:MethodMetadata
Return the name of the method.- 指定者:
getMethodName
在接口中MethodMetadata
getDeclaringClassName
public String getDeclaringClassName()
从接口复制的说明:MethodMetadata
Return the fully-qualified name of the class that declares this method.- 指定者:
getDeclaringClassName
在接口中MethodMetadata
getReturnTypeName
public String getReturnTypeName()
从接口复制的说明:MethodMetadata
Return the fully-qualified name of this method's declared return type.- 指定者:
getReturnTypeName
在接口中MethodMetadata
isAbstract
public boolean isAbstract()
从接口复制的说明:MethodMetadata
Return whether the underlying method is effectively abstract: i.e. marked as abstract on a class or declared as a regular, non-default method in an interface.- 指定者:
isAbstract
在接口中MethodMetadata
isStatic
public boolean isStatic()
从接口复制的说明:MethodMetadata
Return whether the underlying method is declared as 'static'.- 指定者:
isStatic
在接口中MethodMetadata
isFinal
public boolean isFinal()
从接口复制的说明:MethodMetadata
Return whether the underlying method is marked as 'final'.- 指定者:
isFinal
在接口中MethodMetadata
isOverridable
public boolean isOverridable()
从接口复制的说明:MethodMetadata
Return whether the underlying method is overridable, i.e. not marked as static, final or private.- 指定者:
isOverridable
在接口中MethodMetadata
isAnnotated
public boolean isAnnotated(String annotationName)
从接口复制的说明:AnnotatedTypeMetadata
Determine whether the underlying element has an annotation or meta-annotation of the given type defined.If this method returns
true
, thenAnnotatedTypeMetadata.getAnnotationAttributes(java.lang.String)
will return a non-null Map.- 指定者:
isAnnotated
在接口中AnnotatedTypeMetadata
- 参数:
annotationName
- the fully qualified class name of the annotation type to look for- 返回:
- whether a matching annotation is defined
getAnnotationAttributes
public Map<String,Object> getAnnotationAttributes(String annotationName)
从接口复制的说明:AnnotatedTypeMetadata
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation), also taking attribute overrides on composed annotations into account.- 指定者:
getAnnotationAttributes
在接口中AnnotatedTypeMetadata
- 参数:
annotationName
- the fully qualified class name of the annotation type to look for- 返回:
- a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be
null
if no matching annotation is defined.
getAnnotationAttributes
public Map<String,Object> getAnnotationAttributes(String annotationName, boolean classValuesAsString)
从接口复制的说明:AnnotatedTypeMetadata
Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation), also taking attribute overrides on composed annotations into account.- 指定者:
getAnnotationAttributes
在接口中AnnotatedTypeMetadata
- 参数:
annotationName
- the fully qualified class name of the annotation type to look forclassValuesAsString
- whether to convert class references to String class names for exposure as values in the returned Map, instead of Class references which might potentially have to be loaded first- 返回:
- a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be
null
if no matching annotation is defined.
getAllAnnotationAttributes
public MultiValueMap<String,Object> getAllAnnotationAttributes(String annotationName)
从接口复制的说明:AnnotatedTypeMetadata
Retrieve all attributes of all annotations of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation). Note that this variant does not take attribute overrides into account.- 指定者:
getAllAnnotationAttributes
在接口中AnnotatedTypeMetadata
- 参数:
annotationName
- the fully qualified class name of the annotation type to look for- 返回:
- a MultiMap of attributes, with the attribute name as key (e.g. "value") and a list of the defined attribute values as Map value. This return value will be
null
if no matching annotation is defined. - 另请参阅:
AnnotatedTypeMetadata.getAllAnnotationAttributes(String, boolean)
getAllAnnotationAttributes
public MultiValueMap<String,Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString)
从接口复制的说明:AnnotatedTypeMetadata
Retrieve all attributes of all annotations of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation). Note that this variant does not take attribute overrides into account.- 指定者:
getAllAnnotationAttributes
在接口中AnnotatedTypeMetadata
- 参数:
annotationName
- the fully qualified class name of the annotation type to look forclassValuesAsString
- whether to convert class references to String- 返回:
- a MultiMap of attributes, with the attribute name as key (e.g. "value") and a list of the defined attribute values as Map value. This return value will be
null
if no matching annotation is defined. - 另请参阅:
AnnotatedTypeMetadata.getAllAnnotationAttributes(String)