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 WadlGenerator
private final boolean
private final javax.ws.rs.core.UriInfo
-
Constructor Summary
ConstructorsConstructorDescriptionWadlBuilder
(WadlGenerator wadlGenerator, boolean detailedWadl, javax.ws.rs.core.UriInfo uriInfo) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addHint
(Application wadlApplication) private void
addVersion
(Application wadlApplication) Generate WADL for a set of resources.generate
(ApplicationDescription description, Resource resource) Generate WADL for a resource.private Method
generateMethod
(Resource parentResource, Map<String, Param> wadlResourceParams, ResourceMethod resourceMethod) private Param
generateParam
(Resource resource, ResourceMethod method, Parameter param) private Request
generateRequest
(Resource parentResource, ResourceMethod resourceMethod, Map<String, Param> wadlResourceParams) private Resource
generateResource
(Resource r, String path) private Resource
generateResource
(Resource resource, String path, Set<Resource> visitedResources) private Param
getParamByName
(List<Param> params, String name) private Representation
getRepresentationByMediaType
(List<Representation> representations, javax.ws.rs.core.MediaType mediaType) 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.private Representation
setRepresentationForMediaType
(Resource r, ResourceMethod m, javax.ws.rs.core.MediaType mediaType, Request wadlRequest) Create the wadlRepresentation
for the specifiedMediaType
if not yet existing for the wadlRequest
and 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:
resource
- the resourcedescription
- the overall application description so we can- 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 wadlRepresentation
for the specifiedMediaType
if not yet existing for the wadlRequest
and 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
-