org.springframework.util.MethodInvoker#getTypeDifferenceWeight ( )源码实例Demo

下面列出了org.springframework.util.MethodInvoker#getTypeDifferenceWeight ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

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);
}
 
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);
}
 
源代码3 项目: lams   文件: ConstructorResolver.java
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);
}
 
源代码4 项目: blog_demos   文件: ConstructorResolver.java
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);
}
 
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);
}