public class WadlBuilder
extends java.lang.Object
Resource
classes. Wadl artifacts are created by a WadlGenerator
. Created on: Jun 18, 2008Modifier and Type | Field and Description |
---|---|
private WadlGenerator |
_wadlGenerator |
private boolean |
detailedWadl |
private javax.ws.rs.core.UriInfo |
uriInfo |
Constructor and Description |
---|
WadlBuilder(WadlGenerator wadlGenerator,
boolean detailedWadl,
javax.ws.rs.core.UriInfo uriInfo) |
Modifier and Type | Method and Description |
---|---|
private void |
addHint(Application wadlApplication) |
private void |
addVersion(Application wadlApplication) |
Application |
generate(ApplicationDescription description,
Resource resource)
Generate WADL for a resource.
|
ApplicationDescription |
generate(java.util.List<Resource> resources)
Generate WADL for a set of resources.
|
private Method |
generateMethod(Resource parentResource,
java.util.Map<java.lang.String,Param> wadlResourceParams,
ResourceMethod resourceMethod) |
private Param |
generateParam(Resource resource,
ResourceMethod method,
Parameter param) |
private Request |
generateRequest(Resource parentResource,
ResourceMethod resourceMethod,
java.util.Map<java.lang.String,Param> wadlResourceParams) |
private Resource |
generateResource(Resource r,
java.lang.String path) |
private Resource |
generateResource(Resource resource,
java.lang.String path,
java.util.Set<Resource> visitedResources) |
private java.util.List<Response> |
generateResponses(Resource r,
ResourceMethod m) |
private Param |
getParamByName(java.util.List<Param> params,
java.lang.String name) |
private Representation |
getRepresentationByMediaType(java.util.List<Representation> representations,
javax.ws.rs.core.MediaType mediaType) |
private void |
processRequestParameters(Resource parentResource,
ResourceMethod resourceMethod,
java.util.Map<java.lang.String,Param> wadlResourceParams,
java.util.Collection<Parameter> requestParameters,
Request wadlRequest)
Recursively processes provided request parameters and adds the resulting WADL information into the WADL request.
|
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. |
private final WadlGenerator _wadlGenerator
private final javax.ws.rs.core.UriInfo uriInfo
private final boolean detailedWadl
public WadlBuilder(WadlGenerator wadlGenerator, boolean detailedWadl, javax.ws.rs.core.UriInfo uriInfo)
public ApplicationDescription generate(java.util.List<Resource> resources)
resources
- the set of resources.public Application generate(ApplicationDescription description, Resource resource)
resource
- the resourcedescription
- the overall application description so we canprivate void addVersion(Application wadlApplication)
private void addHint(Application wadlApplication)
private Method generateMethod(Resource parentResource, java.util.Map<java.lang.String,Param> wadlResourceParams, ResourceMethod resourceMethod)
private Request generateRequest(Resource parentResource, ResourceMethod resourceMethod, java.util.Map<java.lang.String,Param> wadlResourceParams)
private void processRequestParameters(Resource parentResource, ResourceMethod resourceMethod, java.util.Map<java.lang.String,Param> wadlResourceParams, java.util.Collection<Parameter> requestParameters, Request wadlRequest)
private Representation setRepresentationForMediaType(Resource r, ResourceMethod m, javax.ws.rs.core.MediaType mediaType, Request wadlRequest)
Representation
for the specified MediaType
if not yet existing for the wadl Request
and return it.r
- the resourcem
- the resource methodmediaType
- an accepted media type of the resource methodwadlRequest
- the wadl request the wadl representation is to be created for (if not yet existing).MediaType
.private Representation getRepresentationByMediaType(java.util.List<Representation> representations, javax.ws.rs.core.MediaType mediaType)
private Param generateParam(Resource resource, ResourceMethod method, Parameter param)
private Resource generateResource(Resource resource, java.lang.String path, java.util.Set<Resource> visitedResources)
private java.util.List<Response> generateResponses(Resource r, ResourceMethod m)