This page describes, which javadoc elements are supported and used when generating the WADL. The examples are taken from the extended-wadl-webapp sample.
Javadoc comments
Javadoc comments on resource classes and methods:
- The Javadoc comment of a resource class is added as doc element to the WADL resource.
- The Javadoc comment of a resource method is add as doc element to the WADL method.
You should use sub-resource locators and sub-resources instead of using sub-resource methods, so that your sub-resources get documented in the WADL.
@param tag
If you use params in your resource methods (e.g. @QueryParam), the text of the related @param tag is added as doc element to the WADL param.
@return tag
The text of the @return tag is added as doc element to the WADL response.
Provided custom tags on resource methods
These custom tags are supported on resource methods:
| Tag | Example Value | Description | Example in extended-wadl-webapp sample |
|---|---|---|---|
| @request.representation.qname | {
http://www.example.com
}item |
Sets the element attribute (and xml namespace) for the related request representation | ItemsResource.createItem |
| @request.representation.mediaType | application/xml | Sets the mediaType for the related request representation | ItemsResource.createItem |
| @request.representation.example | {@link Examples#SAMPLE_ITEM} | This can be used to add a doc element showing an example xml for the request representation. For this it follows the specified @link, gets the object instance and marshals it to xml | ItemsResource.createItem |
| @response.param | {@name Location} {@style header} {@type {
http://www.w3.org/2001/XMLSchema
}anyURI} {@doc The URI where the created item is accessable.} |
Adds a param element to the WADL response element with the specified name, style and type attributes and and an additional doc element. | ItemsResource.createItem |
| @response.representation.200.qname | {
http://www.example.com
}item |
Sets the element attribute (and xml namespace) for the response representation with this status code. The status code 200 here is an example, this might be any other number. | ItemResource.getItem |
| @response.representation.200.mediaType | application/xml | Sets the mediaType for the response representation with this status code. | ItemResource.getItem |
| @response.representation.200.example | {@link Examples#SAMPLE_ITEM} | This can be used to add a doc element showing an example xml for the response representation. For this it follows the specified @link, gets the object instance and marshals it to xml | ItemResource.getItem |
| @response.representation.200.doc | Some text | Adds the text as a doc element to the response representation with this status code. | ItemResource.getItem |
User defined custom tags
TODO: Link to documentation of custom DocProcessor and WadlGenerator implementations