* @see org.glassfish.jersey.server.wadl.WadlGenerator#createResponses(org.glassfish.jersey.server.model.Resource,
* org.glassfish.jersey.server.model.ResourceMethod)
*/
public List<Response> createResponses(final org.glassfish.jersey.server.model.Resource r,
final org.glassfish.jersey.server.model.ResourceMethod m) {
final ResponseDocType responseDoc = resourceDoc.getResponse(m.getInvocable().getDefinitionMethod().getDeclaringClass(),
m.getInvocable().getDefinitionMethod());
List<Response> responses = new ArrayList<Response>();
if (responseDoc != null && responseDoc.hasRepresentations()) {
for (final RepresentationDocType representationDoc : responseDoc.getRepresentations()) {
final Response response = new Response();
final Representation wadlRepresentation = new Representation();
wadlRepresentation.setElement(representationDoc.getElement());
wadlRepresentation.setMediaType(representationDoc.getMediaType());
addDocForExample(wadlRepresentation.getDoc(), representationDoc.getExample());
addDoc(wadlRepresentation.getDoc(), representationDoc.getDoc());
response.getStatus().add(representationDoc.getStatus());
response.getRepresentation().add(wadlRepresentation);
responses.add(response);
}
if (!responseDoc.getWadlParams().isEmpty()) {
for (final WadlParamType wadlParamType : responseDoc.getWadlParams()) {
final Param param = new Param();
param.setName(wadlParamType.getName());
param.setStyle(ParamStyle.fromValue(wadlParamType.getStyle()));
param.setType(wadlParamType.getType());
addDoc(param.getDoc(), wadlParamType.getDoc());
for (final Response response : responses) {
response.getParam().add(param);
}
}
}
if (!isEmpty(responseDoc.getReturnDoc())) {
for (final Response response : responses) {
addDoc(response.getDoc(), responseDoc.getReturnDoc());
}
}
} else {
responses = delegate.createResponses(r, m);