boolean form = false;
for (int i = 0; i < l.size(); i++)
{
// Must be only: MatrixParam, QueryParam, PathParam, HeaderParam,
// FormParam, CookieParam, Context and only one of it at each parameter
MethodParameter mp = l.get(i);
if (mp.getAnnotation() == null)
{
if (!entity)
{
entity = true;
if (form) // form already met then check type of entity
checkFormParam(mp.getParameterClass(), mp.getGenericType());
}
else
{
String msg =
"Wrong or absent annotation at parameter with index " + i + " at "
+ rmd.getParentResource().getObjectClass() + "#" + rmd.getMethod().getName();
throw new RuntimeException(msg);
}
}
else
{
if (mp.getAnnotation().annotationType() == FormParam.class)
{
form = true;
if (entity) // entity already met then check type of entity
checkFormParam(mp.getParameterClass(), mp.getGenericType());
}
}
}
}