java - Redirect input from annotation -
this question has answer here:
is there way can give annotation method input. use value returned pass annotation ?
public string fnc(string value){ //do return ret; } @target(elementtype.method) @retention(retentionpolicy.runtime) @interface manon{ string cond = fnc(cond); } @manon(fnc("something")) //does not work @manon("something") public void foo(){ ... } public void bar(){ //reflection call manon = ...getdeclaredannotations()[0] string foo = a; //may not same typed }
Comments
Post a Comment