use of com.sun.research.ws.wadl.Doc in project jersey by jersey.
the class WadlGeneratorResourceDocSupport method createParam.
/**
* @param r Jersey resource component.
* @param m resource method.
* @param p method parameter.
* @return the enhanced {@link Param}.
* @see org.glassfish.jersey.server.wadl.WadlGenerator#createParam(org.glassfish.jersey.server.model.Resource,
* org.glassfish.jersey.server.model.ResourceMethod, org.glassfish.jersey.server.model.Parameter)
*/
public Param createParam(final org.glassfish.jersey.server.model.Resource r, final org.glassfish.jersey.server.model.ResourceMethod m, final Parameter p) {
final Param result = delegate.createParam(r, m, p);
if (result != null) {
final ParamDocType paramDoc = resourceDoc.getParamDoc(m.getInvocable().getDefinitionMethod().getDeclaringClass(), m.getInvocable().getDefinitionMethod(), p);
if (paramDoc != null && !isEmpty(paramDoc.getCommentText())) {
final Doc doc = new Doc();
doc.getContent().add(paramDoc.getCommentText());
result.getDoc().add(doc);
}
}
return result;
}
use of com.sun.research.ws.wadl.Doc in project jersey by jersey.
the class WadlBuilder method addVersion.
private void addVersion(Application wadlApplication) {
// Include Jersey version as doc element with generatedBy attribute
Doc d = new Doc();
d.getOtherAttributes().put(new QName(WadlApplicationContextImpl.WADL_JERSEY_NAMESPACE, "generatedBy", "jersey"), Version.getBuildId());
wadlApplication.getDoc().add(d);
}
use of com.sun.research.ws.wadl.Doc in project jersey by jersey.
the class WadlBuilder method addHint.
private void addHint(Application wadlApplication) {
// TODO: this not-null check is here only because of unit tests
if (uriInfo != null) {
Doc d = new Doc();
String message;
if (detailedWadl) {
final String uriWithoutQueryParam = UriBuilder.fromUri(uriInfo.getRequestUri()).replaceQuery("").build().toString();
message = LocalizationMessages.WADL_DOC_EXTENDED_WADL(WadlUtils.DETAILED_WADL_QUERY_PARAM, uriWithoutQueryParam);
} else {
final String uriWithQueryParam = UriBuilder.fromUri(uriInfo.getRequestUri()).queryParam(WadlUtils.DETAILED_WADL_QUERY_PARAM, "true").build().toString();
message = LocalizationMessages.WADL_DOC_SIMPLE_WADL(WadlUtils.DETAILED_WADL_QUERY_PARAM, uriWithQueryParam);
}
d.getOtherAttributes().put(new QName(WadlApplicationContextImpl.WADL_JERSEY_NAMESPACE, "hint", "jersey"), message);
wadlApplication.getDoc().add(d);
}
}
Aggregations