Search in sources :

Example 6 with Doc

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;
}
Also used : Param(com.sun.research.ws.wadl.Param) Doc(com.sun.research.ws.wadl.Doc) ParamDocType(org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.ParamDocType)

Example 7 with Doc

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);
}
Also used : QName(javax.xml.namespace.QName) Doc(com.sun.research.ws.wadl.Doc)

Example 8 with Doc

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);
    }
}
Also used : QName(javax.xml.namespace.QName) Doc(com.sun.research.ws.wadl.Doc)

Aggregations

Doc (com.sun.research.ws.wadl.Doc)8 QName (javax.xml.namespace.QName)2 Grammars (com.sun.research.ws.wadl.Grammars)1 Include (com.sun.research.ws.wadl.Include)1 Method (com.sun.research.ws.wadl.Method)1 Param (com.sun.research.ws.wadl.Param)1 Resource (com.sun.research.ws.wadl.Resource)1 URI (java.net.URI)1 ProcessingException (javax.ws.rs.ProcessingException)1 UriBuilder (javax.ws.rs.core.UriBuilder)1 JAXBException (javax.xml.bind.JAXBException)1 ResourceMethod (org.glassfish.jersey.server.model.ResourceMethod)1 ClassDocType (org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.ClassDocType)1 MethodDocType (org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.MethodDocType)1 ParamDocType (org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model.ParamDocType)1 Elements (org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.xhtml.Elements)1