本文整理匯總了Java中org.springframework.core.MethodParameter.getContainingClass方法的典型用法代碼示例。如果您正苦於以下問題:Java MethodParameter.getContainingClass方法的具體用法?Java MethodParameter.getContainingClass怎麽用?Java MethodParameter.getContainingClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.core.MethodParameter
的用法示例。
在下文中一共展示了MethodParameter.getContainingClass方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DependencyDescriptor
import org.springframework.core.MethodParameter; //導入方法依賴的package包/類
/**
* Create a new descriptor for a method or constructor parameter.
* @param methodParameter the MethodParameter to wrap
* @param required whether the dependency is required
* @param eager whether this dependency is 'eager' in the sense of
* eagerly resolving potential target beans for type matching
*/
public DependencyDescriptor(MethodParameter methodParameter, boolean required, boolean eager) {
Assert.notNull(methodParameter, "MethodParameter must not be null");
this.methodParameter = methodParameter;
this.declaringClass = methodParameter.getDeclaringClass();
this.containingClass = methodParameter.getContainingClass();
if (this.methodParameter.getMethod() != null) {
this.methodName = methodParameter.getMethod().getName();
this.parameterTypes = methodParameter.getMethod().getParameterTypes();
}
else {
this.parameterTypes = methodParameter.getConstructor().getParameterTypes();
}
this.parameterIndex = methodParameter.getParameterIndex();
this.required = required;
this.eager = eager;
}