Class WadlBuilder

java.lang.Object
org.glassfish.jersey.server.wadl.internal.WadlBuilder

public class WadlBuilder extends Object
This class implements the algorithm how the wadl is built for one or more Resource classes. Wadl artifacts are created by a WadlGenerator. Created on: Jun 18, 2008
  • Field Details

    • _wadlGenerator

      private final WadlGenerator _wadlGenerator
    • uriInfo

      private final javax.ws.rs.core.UriInfo uriInfo
    • detailedWadl

      private final boolean detailedWadl
  • Constructor Details

    • WadlBuilder

      public WadlBuilder(WadlGenerator wadlGenerator, boolean detailedWadl, javax.ws.rs.core.UriInfo uriInfo)
  • Method Details

    • generate

      public ApplicationDescription generate(List<Resource> resources)
      Generate WADL for a set of resources.
      Parameters:
      resources - the set of resources.
      Returns:
      the JAXB WADL application bean.
    • generate

      public Application generate(ApplicationDescription description, Resource resource)
      Generate WADL for a resource.
      Parameters:
      description - the overall application description so we can
      resource - the resource
      Returns:
      the JAXB WADL application bean
    • addVersion

      private void addVersion(Application wadlApplication)
    • addHint

      private void addHint(Application wadlApplication)
    • generateMethod

      private Method generateMethod(Resource parentResource, Map<String,Param> wadlResourceParams, ResourceMethod resourceMethod)
    • generateRequest

      private Request generateRequest(Resource parentResource, ResourceMethod resourceMethod, Map<String,Param> wadlResourceParams)
    • processRequestParameters

      private void processRequestParameters(Resource parentResource, ResourceMethod resourceMethod, Map<String,Param> wadlResourceParams, Collection<Parameter> requestParameters, Request wadlRequest)
      Recursively processes provided request parameters and adds the resulting WADL information into the WADL request.
    • getParamByName

      private Param getParamByName(List<Param> params, String name)
    • setRepresentationForMediaType

      private Representation setRepresentationForMediaType(Resource r, ResourceMethod m, javax.ws.rs.core.MediaType mediaType, Request wadlRequest)
      Create the wadl Representation for the specified MediaType if not yet existing for the wadl Request and return it.
      Parameters:
      r - the resource
      m - the resource method
      mediaType - an accepted media type of the resource method
      wadlRequest - the wadl request the wadl representation is to be created for (if not yet existing).
      Returns:
      the wadl request representation for the specified MediaType.
    • getRepresentationByMediaType

      private Representation getRepresentationByMediaType(List<Representation> representations, javax.ws.rs.core.MediaType mediaType)
    • generateParam

      private Param generateParam(Resource resource, ResourceMethod method, Parameter param)
    • generateResource

      private Resource generateResource(Resource r, String path)
    • generateResource

      private Resource generateResource(Resource resource, String path, Set<Resource> visitedResources)
    • generateResponses

      private List<Response> generateResponses(Resource r, ResourceMethod m)