private void parseMethodParameters(Method method, MethodMetadata methodMetadata) {
logger.trace("parseMethodParameters({}, {}), entry", method, methodMetadata);
Annotation[][] parameterAnnotations = method.getParameterAnnotations();
Type[] paramTypes = getParamTypesFilterByXmlElementAnnotation(method);
boolean entityParamExists = false;
for (int pos = 0, limit = paramTypes.length; pos < limit; pos++) {
Injectable fp =
InjectableFactory.getInstance().create(paramTypes[pos],
parameterAnnotations[pos],
method,
getMetadata().isEncoded() || methodMetadata
.isEncoded(),
methodMetadata.getDefaultValue());
if (fp.getParamType() == Injectable.ParamType.ENTITY) {
if (entityParamExists) {
String methodName =
method.getDeclaringClass().getName() + "." + method.getName();
throw new IllegalStateException(Messages
.getMessage("resourceMethodMoreThanOneEntityParam", methodName));
}
entityParamExists = true;
}
methodMetadata.getFormalParameters().add(fp);
logger.trace("Adding formal parameter {}", fp);
}
logger.trace("parseMethodParameters(), exit");
}