1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| groovyScript(" def result=''; def types = 'String,int,Integer,long,Long,float,Float,double,Double,byte,Byte,short,Short,char,Char,boolean,Boolean'; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]','').split(',').toList(); def paramTypes=\"${_2}\".replaceAll('[\\\\[|\\\\]|\\\\s]','').split(',').toList(); for(i = 0; i < params.size(); i++) { if(types.contains(paramTypes[i].replace('java.lang.',''))){ result+=params[i] + ((i < params.size() - 1) ? ', ' : ''); }else{ result+='JSON.toJSONString(' + params[i] + ((i < params.size() - 1) ? '), ' : ')'); } }; return result; " , methodParameters(), methodParameterTypes())
|