/** * Converts any {@link BigDecimal}-s in the passed array to the type of * the corresponding formal argument of the method via {@link #coerceBigDecimal(BigDecimal, Class)}. */ public static void coerceBigDecimals(Class<?>[] formalTypes, Object[] args) { int typeLen = formalTypes.length; int argsLen = args.length; int min = Math.min(typeLen, argsLen); for (int i = 0; i < min; ++i) { Object arg = args[i]; if (arg instanceof BigDecimal) { args[i] = coerceBigDecimal((BigDecimal) arg, formalTypes[i]); } } if (argsLen > typeLen) { Class<?> varArgType = formalTypes[typeLen - 1]; for (int i = typeLen; i < argsLen; ++i) { Object arg = args[i]; if (arg instanceof BigDecimal) { args[i] = coerceBigDecimal((BigDecimal) arg, varArgType); } } } }
/** * Converts any {@link BigDecimal}s in the passed array to the type of * the corresponding formal argument of the method. */ // Unused? public static void coerceBigDecimals(AccessibleObject callable, Object[] args) { Class<?>[] formalTypes = null; for (int i = 0; i < args.length; ++i) { Object arg = args[i]; if (arg instanceof BigDecimal) { if (formalTypes == null) { if (callable instanceof Method) { formalTypes = ((Method) callable).getParameterTypes(); } else if (callable instanceof Constructor) { formalTypes = ((Constructor<?>) callable).getParameterTypes(); } else { throw new IllegalArgumentException("Expected method or " + " constructor; callable is " + callable.getClass().getName()); } } args[i] = coerceBigDecimal((BigDecimal) arg, formalTypes[i]); } } }
argArray[0] = BeansWrapper.coerceBigDecimal( (BigDecimal) arg, setterMethod.getParameterTypes()[0]);
/** * Converts any {@link BigDecimal}-s in the passed array to the type of * the corresponding formal argument of the method via {@link #coerceBigDecimal(BigDecimal, Class)}. */ public static void coerceBigDecimals(Class<?>[] formalTypes, Object[] args) { int typeLen = formalTypes.length; int argsLen = args.length; int min = Math.min(typeLen, argsLen); for (int i = 0; i < min; ++i) { Object arg = args[i]; if (arg instanceof BigDecimal) { args[i] = coerceBigDecimal((BigDecimal) arg, formalTypes[i]); } } if (argsLen > typeLen) { Class<?> varArgType = formalTypes[typeLen - 1]; for (int i = typeLen; i < argsLen; ++i) { Object arg = args[i]; if (arg instanceof BigDecimal) { args[i] = coerceBigDecimal((BigDecimal) arg, varArgType); } } } }
/** * Converts any {@link BigDecimal}-s in the passed array to the type of * the corresponding formal argument of the method via {@link #coerceBigDecimal(BigDecimal, Class)}. */ public static void coerceBigDecimals(Class<?>[] formalTypes, Object[] args) { int typeLen = formalTypes.length; int argsLen = args.length; int min = Math.min(typeLen, argsLen); for (int i = 0; i < min; ++i) { Object arg = args[i]; if (arg instanceof BigDecimal) { args[i] = coerceBigDecimal((BigDecimal) arg, formalTypes[i]); } } if (argsLen > typeLen) { Class<?> varArgType = formalTypes[typeLen - 1]; for (int i = typeLen; i < argsLen; ++i) { Object arg = args[i]; if (arg instanceof BigDecimal) { args[i] = coerceBigDecimal((BigDecimal) arg, varArgType); } } } }
/** * Converts any {@link BigDecimal}s in the passed array to the type of * the corresponding formal argument of the method. */ public static void coerceBigDecimals(Class[] formalTypes, Object[] args) { int typeLen = formalTypes.length; int argsLen = args.length; int min = Math.min(typeLen, argsLen); for(int i = 0; i < min; ++i) { Object arg = args[i]; if(arg instanceof BigDecimal) { args[i] = coerceBigDecimal((BigDecimal)arg, formalTypes[i]); } } if(argsLen > typeLen) { Class varArgType = formalTypes[typeLen - 1]; for(int i = typeLen; i < argsLen; ++i) { Object arg = args[i]; if(arg instanceof BigDecimal) { args[i] = coerceBigDecimal((BigDecimal)arg, varArgType); } } } }
/** * Converts any {@link BigDecimal}s in the passed array to the type of * the corresponding formal argument of the method. */ // Unused? public static void coerceBigDecimals(AccessibleObject callable, Object[] args) { Class<?>[] formalTypes = null; for (int i = 0; i < args.length; ++i) { Object arg = args[i]; if (arg instanceof BigDecimal) { if (formalTypes == null) { if (callable instanceof Method) { formalTypes = ((Method) callable).getParameterTypes(); } else if (callable instanceof Constructor) { formalTypes = ((Constructor<?>) callable).getParameterTypes(); } else { throw new IllegalArgumentException("Expected method or " + " constructor; callable is " + callable.getClass().getName()); } } args[i] = coerceBigDecimal((BigDecimal) arg, formalTypes[i]); } } }
/** * Converts any {@link BigDecimal}s in the passed array to the type of * the corresponding formal argument of the method. */ public static void coerceBigDecimals(AccessibleObject callable, Object[] args) { Class[] formalTypes = null; for(int i = 0; i < args.length; ++i) { Object arg = args[i]; if(arg instanceof BigDecimal) { if(formalTypes == null) { if(callable instanceof Method) { formalTypes = ((Method)callable).getParameterTypes(); } else if(callable instanceof Constructor) { formalTypes = ((Constructor)callable).getParameterTypes(); } else { throw new IllegalArgumentException("Expected method or " + " constructor; callable is " + callable.getClass().getName()); } } args[i] = coerceBigDecimal((BigDecimal)arg, formalTypes[i]); } } }
/** * Converts any {@link BigDecimal}s in the passed array to the type of * the corresponding formal argument of the method. */ // Unused? public static void coerceBigDecimals(AccessibleObject callable, Object[] args) { Class<?>[] formalTypes = null; for (int i = 0; i < args.length; ++i) { Object arg = args[i]; if (arg instanceof BigDecimal) { if (formalTypes == null) { if (callable instanceof Method) { formalTypes = ((Method) callable).getParameterTypes(); } else if (callable instanceof Constructor) { formalTypes = ((Constructor<?>) callable).getParameterTypes(); } else { throw new IllegalArgumentException("Expected method or " + " constructor; callable is " + callable.getClass().getName()); } } args[i] = coerceBigDecimal((BigDecimal) arg, formalTypes[i]); } } }
aarg[0] = BeansWrapper.coerceBigDecimal( (BigDecimal)arg, m.getParameterTypes()[0]);
argArray[0] = BeansWrapper.coerceBigDecimal( (BigDecimal) arg, setterMethod.getParameterTypes()[0]);
argArray[0] = BeansWrapper.coerceBigDecimal( (BigDecimal) arg, setterMethod.getParameterTypes()[0]);