org.springframework.core.SerializableTypeWrapper.MethodParameterTypeProvider Java Examples

The following examples show how to use org.springframework.core.SerializableTypeWrapper.MethodParameterTypeProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ResolvableType.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Return a {@link ResolvableType} for the specified {@link MethodParameter} with a
 * given implementation type. Use this variant when the class that declares the method
 * includes generic parameter variables that are satisfied by the implementation type.
 * @param methodParameter the source method parameter (must not be {@code null})
 * @param implementationType the implementation type
 * @return a {@link ResolvableType} for the specified method parameter
 * @see #forMethodParameter(MethodParameter)
 */
public static ResolvableType forMethodParameter(MethodParameter methodParameter,
		@Nullable ResolvableType implementationType) {

	Assert.notNull(methodParameter, "MethodParameter must not be null");
	implementationType = (implementationType != null ? implementationType :
			forType(methodParameter.getContainingClass()));
	ResolvableType owner = implementationType.as(methodParameter.getDeclaringClass());
	return forType(null, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).
			getNested(methodParameter.getNestingLevel(), methodParameter.typeIndexesPerLevel);
}
 
Example #2
Source File: ResolvableType.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Resolve the top-level parameter type of the given {@code MethodParameter}.
 * @param methodParameter the method parameter to resolve
 * @since 4.1.9
 * @see MethodParameter#setParameterType
 */
static void resolveMethodParameter(MethodParameter methodParameter) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	ResolvableType owner = forType(methodParameter.getContainingClass()).as(methodParameter.getDeclaringClass());
	methodParameter.setParameterType(
			forType(null, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).resolve());
}
 
Example #3
Source File: ResolvableType.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Return a {@link ResolvableType} for the specified {@link MethodParameter} with a
 * given implementation type. Use this variant when the class that declares the method
 * includes generic parameter variables that are satisfied by the implementation type.
 * @param methodParameter the source method parameter (must not be {@code null})
 * @param implementationType the implementation type
 * @return a {@link ResolvableType} for the specified method parameter
 * @see #forMethodParameter(MethodParameter)
 */
public static ResolvableType forMethodParameter(MethodParameter methodParameter,
		@Nullable ResolvableType implementationType) {

	Assert.notNull(methodParameter, "MethodParameter must not be null");
	implementationType = (implementationType != null ? implementationType :
			forType(methodParameter.getContainingClass()));
	ResolvableType owner = implementationType.as(methodParameter.getDeclaringClass());
	return forType(null, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).
			getNested(methodParameter.getNestingLevel(), methodParameter.typeIndexesPerLevel);
}
 
Example #4
Source File: ResolvableType.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Resolve the top-level parameter type of the given {@code MethodParameter}.
 * @param methodParameter the method parameter to resolve
 * @since 4.1.9
 * @see MethodParameter#setParameterType
 */
static void resolveMethodParameter(MethodParameter methodParameter) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	ResolvableType owner = forType(methodParameter.getContainingClass()).as(methodParameter.getDeclaringClass());
	methodParameter.setParameterType(
			forType(null, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).resolve());
}
 
Example #5
Source File: ResolvableType.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Resolve the top-level parameter type of the given {@code MethodParameter}.
 * @param methodParameter the method parameter to resolve
 * @since 4.1.9
 * @see MethodParameter#setParameterType
 */
static void resolveMethodParameter(MethodParameter methodParameter) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	ResolvableType owner = forType(methodParameter.getContainingClass()).as(methodParameter.getDeclaringClass());
	methodParameter.setParameterType(
			forType(null, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).resolve());
}
 
Example #6
Source File: ResolvableType.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Resolve the top-level parameter type of the given {@code MethodParameter}.
 * @param methodParameter the method parameter to resolve
 * @since 4.1.9
 * @see MethodParameter#setParameterType
 */
static void resolveMethodParameter(MethodParameter methodParameter) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	ResolvableType owner = forType(methodParameter.getContainingClass()).as(methodParameter.getDeclaringClass());
	methodParameter.setParameterType(
			forType(null, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).resolve());
}
 
Example #7
Source File: ResolvableType.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * Return a {@link ResolvableType} for the specified {@link MethodParameter},
 * overriding the target type to resolve with a specific given type.
 * @param methodParameter the source method parameter (must not be {@code null})
 * @param targetType the type to resolve (a part of the method parameter's type)
 * @return a {@link ResolvableType} for the specified method parameter
 * @see #forMethodParameter(Method, int)
 */
public static ResolvableType forMethodParameter(MethodParameter methodParameter, @Nullable Type targetType) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	ResolvableType owner = forType(methodParameter.getContainingClass()).as(methodParameter.getDeclaringClass());
	return forType(targetType, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).
			getNested(methodParameter.getNestingLevel(), methodParameter.typeIndexesPerLevel);
}
 
Example #8
Source File: ResolvableType.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * Return a {@link ResolvableType} for the specified {@link MethodParameter},
 * overriding the target type to resolve with a specific given type.
 * @param methodParameter the source method parameter (must not be {@code null})
 * @param targetType the type to resolve (a part of the method parameter's type)
 * @return a {@link ResolvableType} for the specified method parameter
 * @see #forMethodParameter(Method, int)
 */
public static ResolvableType forMethodParameter(MethodParameter methodParameter, @Nullable Type targetType) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	ResolvableType owner = forType(methodParameter.getContainingClass()).as(methodParameter.getDeclaringClass());
	return forType(targetType, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).
			getNested(methodParameter.getNestingLevel(), methodParameter.typeIndexesPerLevel);
}
 
Example #9
Source File: ResolvableType.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Return a {@link ResolvableType} for the specified {@link MethodParameter} with a
 * given implementation type. Use this variant when the class that declares the method
 * includes generic parameter variables that are satisfied by the implementation type.
 * @param methodParameter the source method parameter (must not be {@code null})
 * @param implementationType the implementation type
 * @return a {@link ResolvableType} for the specified method parameter
 * @see #forMethodParameter(MethodParameter)
 */
public static ResolvableType forMethodParameter(MethodParameter methodParameter, ResolvableType implementationType) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	implementationType = (implementationType != null ? implementationType :
			forType(methodParameter.getContainingClass()));
	ResolvableType owner = implementationType.as(methodParameter.getDeclaringClass());
	return forType(null, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).
			getNested(methodParameter.getNestingLevel(), methodParameter.typeIndexesPerLevel);
}
 
Example #10
Source File: ResolvableType.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Return a {@link ResolvableType} for the specified {@link MethodParameter},
 * overriding the target type to resolve with a specific given type.
 * @param methodParameter the source method parameter (must not be {@code null})
 * @param targetType the type to resolve (a part of the method parameter's type)
 * @return a {@link ResolvableType} for the specified method parameter
 * @see #forMethodParameter(Method, int)
 */
public static ResolvableType forMethodParameter(MethodParameter methodParameter, Type targetType) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	ResolvableType owner = forType(methodParameter.getContainingClass()).as(methodParameter.getDeclaringClass());
	return forType(targetType, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).
			getNested(methodParameter.getNestingLevel(), methodParameter.typeIndexesPerLevel);
}
 
Example #11
Source File: ResolvableType.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * Return a {@link ResolvableType} for the specified {@link MethodParameter} with a
 * given implementation type. Use this variant when the class that declares the method
 * includes generic parameter variables that are satisfied by the implementation type.
 * @param methodParameter the source method parameter (must not be {@code null})
 * @param implementationType the implementation type
 * @return a {@link ResolvableType} for the specified method parameter
 * @see #forMethodParameter(MethodParameter)
 */
public static ResolvableType forMethodParameter(MethodParameter methodParameter, ResolvableType implementationType) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	implementationType = (implementationType != null ? implementationType :
			forType(methodParameter.getContainingClass()));
	ResolvableType owner = implementationType.as(methodParameter.getDeclaringClass());
	return forType(null, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).
			getNested(methodParameter.getNestingLevel(), methodParameter.typeIndexesPerLevel);
}
 
Example #12
Source File: ResolvableType.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * Return a {@link ResolvableType} for the specified {@link MethodParameter},
 * overriding the target type to resolve with a specific given type.
 * @param methodParameter the source method parameter (must not be {@code null})
 * @param targetType the type to resolve (a part of the method parameter's type)
 * @return a {@link ResolvableType} for the specified method parameter
 * @see #forMethodParameter(Method, int)
 */
public static ResolvableType forMethodParameter(MethodParameter methodParameter, Type targetType) {
	Assert.notNull(methodParameter, "MethodParameter must not be null");
	ResolvableType owner = forType(methodParameter.getContainingClass()).as(methodParameter.getDeclaringClass());
	return forType(targetType, new MethodParameterTypeProvider(methodParameter), owner.asVariableResolver()).
			getNested(methodParameter.getNestingLevel(), methodParameter.typeIndexesPerLevel);
}