private void addMethod( ActionType actionType, Resource res, IMethodModel m, IDocInfo documentation, String returnName, String parameterName) { Action action = new Action(); String description = documentation.getDocumentation(); if (!"".equals(description)) { // $NON-NLS-1$ action.setDescription(description); } ActionType adjustedActionType = adjustActionType(m, actionType); action.setType(adjustedActionType); res.getActions().put(adjustedActionType, action); processResponses(m, action, documentation, returnName); IParameterModel[] parameters = m.getParameters(); for (IParameterModel pm : parameters) { if (pm.hasAnnotation(QUERY_PARAM)) { IAnnotationModel paramAnnotation = pm.getAnnotation(QUERY_PARAM); QueryParameter value2 = new QueryParameter(); String paramName = configureParam(pm, value2, documentation, paramAnnotation); action.getQueryParameters().put(paramName, value2); } } for (IParameterModel pm : parameters) { if (pm.hasAnnotation(HEADER_PARAM)) { IAnnotationModel paramAnnotation = pm.getAnnotation(HEADER_PARAM); Header value2 = new Header(); String paramName = configureParam(pm, value2, documentation, paramAnnotation); action.getHeaders().put(paramName, value2); } } for (IParameterModel pm : parameters) { if (pm.hasAnnotation(PATH_PARAM)) { IAnnotationModel paramAnnotation = pm.getAnnotation(PATH_PARAM); UriParameter value2 = new UriParameter(); String paramName = configureParam(pm, value2, documentation, paramAnnotation); res.getUriParameters().put(paramName, value2); } } boolean hasBody = m.getBodyType() != null; String[] consumesValue = extractMediaTypes(m, CONSUMES, classConsumes, hasBody, adjustedActionType); if (consumesValue != null) { for (String s : consumesValue) { s = sanitizeMediaType(s); MimeType bodyType = new MimeType(); tryAppendSchemesAndExamples(bodyType, s, parameterName); bodyType.setType(s); if (s.contains(FORM)) { for (IParameterModel pm : parameters) { if (pm.hasAnnotation(FORM_PARAM)) { IAnnotationModel paramAnnotation = pm.getAnnotation(FORM_PARAM); FormParameter vl = new FormParameter(); String paramName = configureParam(pm, vl, documentation, paramAnnotation); ArrayList<FormParameter> arrayList = new ArrayList<FormParameter>(); arrayList.add(vl); if (bodyType.getFormParameters() == null) { bodyType.setFormParameters(new HashMap<String, java.util.List<FormParameter>>()); } bodyType.getFormParameters().put(paramName, arrayList); } } } action.getBody().put(s, bodyType); } } }