org.springframework.core.ResolvableType.resolveMethodParameter()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.springframework.core.ResolvableType.resolveMethodParameter方法的一些代码示例,展示了ResolvableType.resolveMethodParameter的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResolvableType.resolveMethodParameter方法的具体详情如下:
包路径:org.springframework.core.ResolvableType
类名称:ResolvableType
方法名:resolveMethodParameter

ResolvableType.resolveMethodParameter介绍

[英]Resolve the top-level parameter type of the given MethodParameter.
[中]解析给定MethodParameter的顶级参数类型。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Determine the target type for the given generic parameter type.
 * @param methodParameter the method parameter specification
 * @param implementationClass the class to resolve type variables against
 * @return the corresponding generic parameter or return type
 */
public static Class<?> resolveParameterType(MethodParameter methodParameter, Class<?> implementationClass) {
  Assert.notNull(methodParameter, "MethodParameter must not be null");
  Assert.notNull(implementationClass, "Class must not be null");
  methodParameter.setContainingClass(implementationClass);
  ResolvableType.resolveMethodParameter(methodParameter);
  return methodParameter.getParameterType();
}

代码示例来源:origin: org.springframework/spring-core

/**
 * Determine the target type for the given generic parameter type.
 * @param methodParameter the method parameter specification
 * @param implementationClass the class to resolve type variables against
 * @return the corresponding generic parameter or return type
 */
public static Class<?> resolveParameterType(MethodParameter methodParameter, Class<?> implementationClass) {
  Assert.notNull(methodParameter, "MethodParameter must not be null");
  Assert.notNull(implementationClass, "Class must not be null");
  methodParameter.setContainingClass(implementationClass);
  ResolvableType.resolveMethodParameter(methodParameter);
  return methodParameter.getParameterType();
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Determine the target type for the given generic parameter type.
 * @param methodParameter the method parameter specification
 * @param implementationClass the class to resolve type variables against
 * @return the corresponding generic parameter or return type
 */
public static Class<?> resolveParameterType(MethodParameter methodParameter, Class<?> implementationClass) {
  Assert.notNull(methodParameter, "MethodParameter must not be null");
  Assert.notNull(implementationClass, "Class must not be null");
  methodParameter.setContainingClass(implementationClass);
  ResolvableType.resolveMethodParameter(methodParameter);
  return methodParameter.getParameterType();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

/**
 * Determine the target type for the given generic parameter type.
 * @param methodParameter the method parameter specification
 * @param implementationClass the class to resolve type variables against
 * @return the corresponding generic parameter or return type
 */
public static Class<?> resolveParameterType(MethodParameter methodParameter, Class<?> implementationClass) {
  Assert.notNull(methodParameter, "MethodParameter must not be null");
  Assert.notNull(implementationClass, "Class must not be null");
  methodParameter.setContainingClass(implementationClass);
  ResolvableType.resolveMethodParameter(methodParameter);
  return methodParameter.getParameterType();
}

相关文章

微信公众号

最新文章

更多