Class WadlBuilder
java.lang.Object
org.glassfish.jersey.server.wadl.internal.WadlBuilder
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final WadlGeneratorprivate final booleanprivate final javax.ws.rs.core.UriInfo -
Constructor Summary
ConstructorsConstructorDescriptionWadlBuilder(WadlGenerator wadlGenerator, boolean detailedWadl, javax.ws.rs.core.UriInfo uriInfo) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddHint(Application wadlApplication) private voidaddVersion(Application wadlApplication) Generate WADL for a set of resources.generate(ApplicationDescription description, Resource resource) Generate WADL for a resource.private MethodgenerateMethod(Resource parentResource, Map<String, Param> wadlResourceParams, ResourceMethod resourceMethod) private ParamgenerateParam(Resource resource, ResourceMethod method, Parameter param) private RequestgenerateRequest(Resource parentResource, ResourceMethod resourceMethod, Map<String, Param> wadlResourceParams) private ResourcegenerateResource(Resource r, String path) private ResourcegenerateResource(Resource resource, String path, Set<Resource> visitedResources) private ParamgetParamByName(List<Param> params, String name) private RepresentationgetRepresentationByMediaType(List<Representation> representations, javax.ws.rs.core.MediaType mediaType) private voidprocessRequestParameters(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.private RepresentationsetRepresentationForMediaType(Resource r, ResourceMethod m, javax.ws.rs.core.MediaType mediaType, Request wadlRequest) Create the wadlRepresentationfor the specifiedMediaTypeif not yet existing for the wadlRequestand return it.
-
Field Details
-
_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
Generate WADL for a set of resources.- Parameters:
resources- the set of resources.- Returns:
- the JAXB WADL application bean.
-
generate
Generate WADL for a resource.- Parameters:
description- the overall application description so we canresource- the resource- Returns:
- the JAXB WADL application bean
-
addVersion
-
addHint
-
generateMethod
-
generateRequest
-
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
-
setRepresentationForMediaType
private Representation setRepresentationForMediaType(Resource r, ResourceMethod m, javax.ws.rs.core.MediaType mediaType, Request wadlRequest) Create the wadlRepresentationfor the specifiedMediaTypeif not yet existing for the wadlRequestand return it.- Parameters:
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).- Returns:
- the wadl request representation for the specified
MediaType.
-
getRepresentationByMediaType
private Representation getRepresentationByMediaType(List<Representation> representations, javax.ws.rs.core.MediaType mediaType) -
generateParam
-
generateResource
-
generateResource
-
generateResponses
-