* to the configuration
*/
@Override
public Object run(ConfigBeanProxy param) throws PropertyVetoException, TransactionFailure {
WriteableView writeableParent = (WriteableView)Proxy.getInvocationHandler(param);
StringTokenizer st = new StringTokenizer(values, ",");
List<String> valList = new ArrayList<String>();
while (st.hasMoreTokens()) valList.add(st.nextToken());
ConfigBean bean = writeableParent.getMasterView();
for (Method m : writeableParent.getProxyType().getMethods()) {
// Check to see if the method is a setter for the element
// An element setter has to have the right name, take a single
// collection parameter that parameterized with the right type
Class argClasses[] = m.getParameterTypes();
Type argTypes[] = m.getGenericParameterTypes();
if (!bean.model.toProperty(m).xmlName().equals(elementName) ||
argClasses.length != 1 ||
!Collection.class.isAssignableFrom(argClasses[0]) ||
argTypes.length != 1 ||
!(argTypes[0] instanceof ParameterizedType) ||
!Types.erasure(Types.getTypeArgument(argTypes[0], 0)).isAssignableFrom(values.getClass())) {
continue;
}
// we have the right method. Now call it
try {
m.invoke(writeableParent.getProxy(writeableParent.<ConfigBeanProxy>getProxyType()), valList);
} catch (IllegalAccessException e) {
throw new TransactionFailure("Exception while setting element", e);
} catch (InvocationTargetException e) {
throw new TransactionFailure("Exception while setting element", e);
}