}
}
private Object[] getParams(Method method) {
RequestMapper map = new RequestMapper();
map.setApplicationContext(applicationContext);
map.setRequest(request);
map.setResponse(response);
map.setRequestProcessor(requestProcessor);
Class<?>[] types = method.getParameterTypes();
Object[] params = null;
// get parameters
if(types.length > 0) {
params = new Object[types.length];
}
Annotation[][] parameters = method.getParameterAnnotations();
for(int i=0; i<parameters.length; i++) {
Class<?> type = types[i];
Annotation annotation = null;
if(parameters[i].length > 0 ) {
for(Annotation an: parameters[i]) {
if(an.annotationType().isAssignableFrom(Param.class)) {
annotation = an;
break;
}
}
}
params[i] = map.map(method.getClass().getName(),method.getName(),type, annotation);
}
return params;
}