// determine name
String name;
String paramType= BODY_INDICATOR;
PathParam pp = paramElement.getAnnotation(PathParam.class);
QueryParam qp = paramElement.getAnnotation(QueryParam.class);
ApiParam ap = paramElement.getAnnotation(ApiParam.class);
if (pp != null) {
name = pp.value();
paramType="Path";
}
else if (qp!=null) {
name = qp.value();
paramType="Query";
}
else if (ap!=null)
name = ap.name();
else {
Name nameElement = paramElement.getSimpleName();
name = nameElement.toString();
}
element.setAttribute("name", name);
element.setAttribute("paramType",paramType);
ApiParam apiParam = paramElement.getAnnotation(ApiParam.class);
if (apiParam!=null) {
String description = apiParam.value();
setOptionalAttribute(element, "description", description);
String required = String.valueOf(apiParam.required());
if (pp!=null || paramType.equals(BODY_INDICATOR)) // PathParams are always required
required="true";
setOptionalAttribute(element, "required", required, "false");
String allowedValues = apiParam.allowableValues();
setOptionalAttribute(element, "allowableValues", allowedValues, "all");
}
String defaultValue;
DefaultValue dva = paramElement.getAnnotation(DefaultValue.class);
if (dva!=null)