* @throws IllegalArgumentException
* In case no setter is found or multiple setters are found.
*/
- public SetterConfiguration add(final Class aType) {
+ public SetterConfiguration addSetter(final Class aType) {
List<Method> result = new ArrayList<Method>();
CollectionFilter.filter(getAllSetters(_class, _publicOnly), result,
new Condition<Method>() {
return result;
}
- private static ParameterValues createParameterValues(Method method) {
- // TODO generalize to multiple parameters.
- return new ParameterValues(
- new String[] { method.getName() }, new Class[] { method
- .getParameterTypes()[0] });
+ private static ParameterValues createParameterValues(Method aMethod) {
+
+ Class[] paramTypes = aMethod.getParameterTypes();
+ String[] paramNames = new String[paramTypes.length];
+ for (int i = 0; i < paramTypes.length; i++) {
+ paramNames[i] = aMethod.getName() + "." + i;
+ }
+ return new ParameterValues(paramNames, paramTypes);
}
private static final List<Method> getAllMethods(Class aClass) {