(no commit message)
[utils] / trunk / system / general / src / main / java / org / wamblee / system / adapters / SetterConfiguration.java
index 15c101dcc1ce9d50a69a93bbb57d5abe9457abb3..57323a54b409531f53667e9d771c4f9d542a0060 100644 (file)
@@ -171,7 +171,7 @@ public class SetterConfiguration {
         * @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>() {
@@ -223,11 +223,14 @@ public class SetterConfiguration {
                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) {