Class<?>[] types = method.getParameterTypes();
Annotation[][] parameters = method.getParameterAnnotations();
for(int i=0; i<parameters.length; i++) {
Class<?> type = types[i];
Param annotation = null;
if(parameters[i].length > 0 ) {
for(Annotation an: parameters[i]) {
if(an.annotationType().isAssignableFrom(Param.class)) {
annotation = (Param) an;
break;
}
}
}
if(annotation != null) {
params.put(annotation.value(), type.getName());
}
}
if(params.size() > 0) {
action.put("params", params);