Search in sources :

Example 1 with ResponseParameter

use of com.iggroup.oss.restdoclet.doclet.type.ResponseParameter in project RESTdoclet by IG-Group.

the class MethodBuilder method initResponseParams.

private void initResponseParams(Method method, final MethodDoc methodDoc) {
    ArrayList<ResponseParameter> responseParams = new ArrayList<ResponseParameter>();
    // Add return type
    if (methodDoc.returnType() != null) {
        responseParams.add(new ResponseParameter(DocTypeUtils.getTypeName(methodDoc.returnType()), DocTypeUtils.getTypeName(methodDoc.returnType()), DocletUtils.preserveJavadocFormatting(DocTypeUtils.getReturnDoc(methodDoc))));
    }
    // Add any checked exceptions
    for (ClassDoc exceptionDoc : methodDoc.thrownExceptions()) {
        responseParams.add(new ResponseParameter(DocTypeUtils.getTypeName(exceptionDoc), DocTypeUtils.getTypeName(exceptionDoc), DocletUtils.preserveJavadocFormatting(DocTypeUtils.getTypeDoc(exceptionDoc))));
    }
    method.setResponseParams(responseParams);
}
Also used : ResponseParameter(com.iggroup.oss.restdoclet.doclet.type.ResponseParameter) ArrayList(java.util.ArrayList) ClassDoc(com.sun.javadoc.ClassDoc)

Aggregations

ResponseParameter (com.iggroup.oss.restdoclet.doclet.type.ResponseParameter)1 ClassDoc (com.sun.javadoc.ClassDoc)1 ArrayList (java.util.ArrayList)1