addRoute(method, fastClass.getJavaClass().getName(), controllerVariable, action, isDefaultController);
}
private EntityMarshaller getParamEntityMarshaller(Method method, String className) {
EntityMarshaller paramMarshaller = new DefaultEntityMarshaller();
Annotation[][] paramAnnotations = method.getParameterAnnotations();
List<Entity> entityAnnotations = new ArrayList<Entity>();
for (Annotation[] annotationsForParam : paramAnnotations) {
for (Annotation annotation : annotationsForParam) {
if (annotation instanceof Entity) {
entityAnnotations.add((Entity)annotation);
}
}
}
if (!entityAnnotations.isEmpty()) {
if (entityAnnotations.size() > 1) {
throw new ConfigurationException("action " + method.getName() + " in controller "
+ className + " has more than one " + Entity.class.getName() + " annotation");
}
Expects expectsAnn = method.getAnnotation(Expects.class);
if (expectsAnn == null) {
throw new ConfigurationException("action " + method.getName() + " in controller "
+ className + " has an " + Entity.class.getName() + " annotation, but no "
+ Expects.class.getName() + " exists");
}
String contentType = expectsAnn.value();
EntityMarshaller marshaller = entityMarshallerMap.get(contentType);
if (marshaller != null) {
paramMarshaller = marshaller;
} else {
logger.error("could not find parameter entity marshaller for content type "
+ contentType + " for action " + method.getName() + " in controller "