I want to create an endpoint which has a PathParam
that automatically calls the constructor of an object to be injected, which has a constructor of a String argument. To spell it out in code:
Here is the resource
@GET
@Path("/{apiVersion}" + "/item")
public Response version(@PathParam("apiVersion") APIVersion apiVersion) {
return Response.ok().build();
}
I want the String to automatically be used in a call to the APIVersion constructor. In the APIVersion
class
public APIVersion(String apiVersion) {
this.versionString = apiVersion;
}
Is it possible to do with only access to annotations? I do not have access to the ResourceConfig
.