Search in sources :

Example 1 with RequestDocType

use of org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.RequestDocType in project jersey by jersey.

the class ResourceDoclet method addRequestRepresentationDoc.

private static void addRequestRepresentationDoc(final MethodDoc methodDoc, final MethodDocType methodDocType) {
    final Tag requestElement = getSingleTagOrNull(methodDoc, "request.representation.qname");
    final Tag requestExample = getSingleTagOrNull(methodDoc, "request.representation.example");
    if (requestElement != null || requestExample != null) {
        final RequestDocType requestDoc = new RequestDocType();
        final RepresentationDocType representationDoc = new RepresentationDocType();
        /* requestElement exists
             */
        if (requestElement != null) {
            representationDoc.setElement(QName.valueOf(requestElement.text()));
        }
        /* requestExample exists
             */
        if (requestExample != null) {
            final String example = getSerializedExample(requestExample);
            if (!isEmpty(example)) {
                representationDoc.setExample(example);
            } else {
                LOG.warning("Could not get serialized example for method " + methodDoc.qualifiedName());
            }
        }
        requestDoc.setRepresentationDoc(representationDoc);
        methodDocType.setRequestDoc(requestDoc);
    }
}
Also used : Tag(com.sun.javadoc.Tag) ParamTag(com.sun.javadoc.ParamTag) SeeTag(com.sun.javadoc.SeeTag) RequestDocType(org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.RequestDocType) RepresentationDocType(org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.RepresentationDocType)

Aggregations

ParamTag (com.sun.javadoc.ParamTag)1 SeeTag (com.sun.javadoc.SeeTag)1 Tag (com.sun.javadoc.Tag)1 RepresentationDocType (org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.RepresentationDocType)1 RequestDocType (org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.RequestDocType)1