Java Code Examples for org.springframework.util.MethodInvoker#getTypeDifferenceWeight()

The following examples show how to use org.springframework.util.MethodInvoker#getTypeDifferenceWeight() . 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: ConstructorResolver.java    From spring-analysis-note with MIT License 5 votes vote down vote up
public int getTypeDifferenceWeight(Class<?>[] paramTypes) {
	// If valid arguments found, determine type difference weight.
	// Try type difference weight on both the converted arguments and
	// the raw arguments. If the raw weight is better, use it.
	// Decrease raw weight by 1024 to prefer it over equal converted weight.
	int typeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.arguments);
	int rawTypeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.rawArguments) - 1024;
	return Math.min(rawTypeDiffWeight, typeDiffWeight);
}
 
Example 2
Source File: ConstructorResolver.java    From java-technology-stack with MIT License 5 votes vote down vote up
public int getTypeDifferenceWeight(Class<?>[] paramTypes) {
	// If valid arguments found, determine type difference weight.
	// Try type difference weight on both the converted arguments and
	// the raw arguments. If the raw weight is better, use it.
	// Decrease raw weight by 1024 to prefer it over equal converted weight.
	int typeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.arguments);
	int rawTypeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.rawArguments) - 1024;
	return (rawTypeDiffWeight < typeDiffWeight ? rawTypeDiffWeight : typeDiffWeight);
}
 
Example 3
Source File: ConstructorResolver.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public int getTypeDifferenceWeight(Class<?>[] paramTypes) {
	// If valid arguments found, determine type difference weight.
	// Try type difference weight on both the converted arguments and
	// the raw arguments. If the raw weight is better, use it.
	// Decrease raw weight by 1024 to prefer it over equal converted weight.
	int typeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.arguments);
	int rawTypeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.rawArguments) - 1024;
	return (rawTypeDiffWeight < typeDiffWeight ? rawTypeDiffWeight : typeDiffWeight);
}
 
Example 4
Source File: ConstructorResolver.java    From blog_demos with Apache License 2.0 5 votes vote down vote up
public int getTypeDifferenceWeight(Class<?>[] paramTypes) {
	// If valid arguments found, determine type difference weight.
	// Try type difference weight on both the converted arguments and
	// the raw arguments. If the raw weight is better, use it.
	// Decrease raw weight by 1024 to prefer it over equal converted weight.
	int typeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.arguments);
	int rawTypeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.rawArguments) - 1024;
	return (rawTypeDiffWeight < typeDiffWeight ? rawTypeDiffWeight : typeDiffWeight);
}
 
Example 5
Source File: ConstructorResolver.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
public int getTypeDifferenceWeight(Class<?>[] paramTypes) {
	// If valid arguments found, determine type difference weight.
	// Try type difference weight on both the converted arguments and
	// the raw arguments. If the raw weight is better, use it.
	// Decrease raw weight by 1024 to prefer it over equal converted weight.
	int typeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.arguments);
	int rawTypeDiffWeight = MethodInvoker.getTypeDifferenceWeight(paramTypes, this.rawArguments) - 1024;
	return (rawTypeDiffWeight < typeDiffWeight ? rawTypeDiffWeight : typeDiffWeight);
}