i need generate following kinds of code stringtemplate4: methodfoo0(connection conn); methodfoo1(connection conn, int arg1); methodfoo2(connection conn, int arg1, int arg2); etc. the "connection conn" part present passing method name , rest of arguments st template. template looks follows: <methodname>(connection conn, <args; separator=", ">); this works produces comma when there no arguments @ (except conn): methodfoo0(connection conn,); to eliminate comma tried using if conditional , length st4 function couldn't work although tried various combos following: <methodname>(connection conn <if (length(fieldsinfind) \> 0)>,<else><endif><fieldsinfind; separator=", ">) ... , others failed parsing-related error ( mismatched input ). in end, gave , resorted passing comma parameter template either "," or empty string "" based on pre-rendering logic. you check p...
Comments
Post a Comment