// afterPropertiesSet
if (parameters[i] instanceof InitializingBean) {
((InitializingBean) parameters[i]).afterPropertiesSet();
}
if (parameters[i] == null) {
DefValue defValudeAnnotation = paramMetaDatas[i].getAnnotation(DefValue.class);
if (defValudeAnnotation != null && paramMetaDatas[i].getParamType() == String.class) {
parameters[i] = defValudeAnnotation.value();
}
}
} catch (TypeMismatchException e) {
// 出现这个错误肯定是解析一般参数失败导致的,而非bean里面的某个属性值的解析失败
logger.debug("", e);
// 对简单类型的参数,设置一个默认值给它以支持对该方法的继续调用
if (paramMetaDatas[i].getParamType().isPrimitive()) {
DefValue defValudeAnnotation = paramMetaDatas[i].getAnnotation(DefValue.class);
if (defValudeAnnotation == null
|| DefValue.NATIVE_DEFAULT.equals(defValudeAnnotation.value())) {
// 对这最常用的类型做一下if-else判断,其他类型就简单使用converter来做吧
if (paramMetaDatas[i].getParamType() == int.class) {
parameters[i] = Integer.valueOf(0);
} else if (paramMetaDatas[i].getParamType() == long.class) {
parameters[i] = Long.valueOf(0);
} else if (paramMetaDatas[i].getParamType() == boolean.class) {
parameters[i] = Boolean.FALSE;
} else if (paramMetaDatas[i].getParamType() == double.class) {
parameters[i] = Double.valueOf(0);
} else if (paramMetaDatas[i].getParamType() == float.class) {
parameters[i] = Float.valueOf(0);
} else {
TypeConverter typeConverter = SafedTypeConverterFactory
.getCurrentConverter();
parameters[i] = typeConverter.convertIfNecessary("0", paramMetaDatas[i]
.getParamType());
}
} else {
TypeConverter typeConverter = SafedTypeConverterFactory
.getCurrentConverter();
parameters[i] = typeConverter.convertIfNecessary(defValudeAnnotation
.value(), paramMetaDatas[i].getParamType());
}
}
//
String paramName = parameterNames[i];