java - Generic List and reflection -


i'd call via reflection following method, have problem specify correct signature:

 public void executerule(list<node> params, somethingstrangefound callmeback) throws ioexception  {       ...  } 

i tried this:

 class partypes[] = new class[2];  partypes[0] = class.forname("java.util.list");                   partypes[1] = class.forname("vp.somethingstrangefound");   method meth = cls.getmethod("executerule", partypes); 

it doesn't work because use "java.util.list" when must "list<node>", have no idea how specify it.

if use "java.util.list", have following error calling cls.getmethod("executerule", partypes):

 nosuchmethodexception: vp.rulewebxmlcontextparamfacesportletrenderstyles.executerule(java.util.list, vp.somethingstrangefound) 

any help?

p.s. @ debug time, see "list<node>" resolved with: (ljava/util/list<lorg/w3c/dom/node;>;lit/vp/somethingstrangefound;)v

but doesn't me.

i ran code , worked me. have not provided definition of cls, assume

class cls = rulewebxmlcontextparamfacesportletrenderstyles.class; 

since nosuchmethodexception, class.forname passed successfully, no typo there (unless have multiple somethingstrangefound classes, mean got package wrong).

because of last thing comes mind perhaps compiled rulewebxmlcontextparamfacesportletrenderstyles before adding method in question. clean code , recompile.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -