Hi I need to do something similar as the
propertyresolver does. Therefore im writing to the wicket userlist. I have a component that can update a list of other
components by a It gets the value by calling a method which were
provided and the required parameters was also provided, it does this by using java.lang.reflect.Method.
In my effort on trying to make this a bit more
generic component I was trying to have an arraylist which contained class’s
and IModels. Setting up the method was fine and simple enough,
currently im stuck when trying to build the list of parameters im wondering if
I have to typecast the parameters at all or if reflection will handle that, because
of what I did in the setupMethod method, I am betting the latter? //sniplet private
void setupMethod(Object myProvider, String sMethod) { Class
partypes[] = new Class[parameters.size()]; for
(int i = 0; i < parameters.size(); i++) { Object[]
params = (Object[]) parameters.get(i); partypes[i]
= (Class) params[0]; } Method
method; try
{ method
= myProvider.getClass().getMethod(sMethod, partypes); }
catch (Exception e) { … } this.dbprovidermethod
= method; } private
Object[] fillParameters() { Object
param[] = new Object[parameters.size()]; for
(int i = 0; i < parameters.size(); i++) { Object[]
params = (Object[]) parameters.get(i); Class
clazz=(Class) params[0]; param[i] = (clazz) params[1]; } return
param; } //sniplet |
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user