List<Parameter> result = new ArrayList<Parameter>(parameters.length);
int paramIndex = 1;
Annotation[][] annotations = method.getParameterAnnotations();
for (int i = 0; i < parameters.length; i++) {
if (isParameter(method.getParameterAnnotations()[i])) {
QueryParam qpAnnotation = extractFrom(annotations[i], QueryParam.class);
if (qpAnnotation != null) {
result.add(new NamedParameter(qpAnnotation.value(), parameters[i], i));
} else {
result.add(new IndexedParameter(paramIndex++, parameters[i], i));
}
} else {
max = extractInt(parameters[i], annotations[i], MaxResults.class, max);