java - GWT: Native method using JSNI: how to call methods dynamically -


i using gwt , have created native method calls method cmd_addspace in class everlinkedactions , works fine now:

private static native string execute(string functionname,  object[] vparams)/*-{   try{                 @es.gwt.client.dash.actions.impl.everlinkedactions::cmd_addspace([ljava/lang/object;)(vparams);             }catch(e){       alert(e.message);   }  }-*/; 

how can make method name dynamic? means instead of "cmd_addspace" want call method "functionname" name passed argument in native method.

and way make class name dynamic? want have that:

private static native string execute(string classname, string functionname,  object[] vparams)/*-{   try{                 @es.gwt.client.dash.actions.impl.classname::functionname([ljava/lang/object;)(vparams);             }catch(e){       alert(e.message);   }  }-*/; 

thanks help

not sure you're trying achieve here i'm afraid jsni doesn't work that.

code such @es.gwt.client.dash.actions.impl.everlinkedactions::cmd_addspace([ljava/lang/object;)(vparams); needs resolvable symbol @ compile time because class , method names replaced minimised versions.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -