Class ResourceMethodInfo
java.lang.Object
ru.vyarus.dropwizard.guice.url.model.ResourceMethodInfo
The result of
MethodCall analysis. Used to pre-fill request
parameters by method annotations and provided arguments.
For sub resource call, subResources would not be empty, resource would point to the ROOT
resource and path will be a method path, relative to resource root (include sub resource locator paths).
- Since:
- 25.09.2025
-
Constructor Summary
ConstructorsConstructorDescriptionResourceMethodInfo(Class<?> resource, String resourcePath, Method method, String path, @Nullable String httpMethod) Create a resource method info object.ResourceMethodInfo(Class<?> resource, String resourcePath, Method method, String path, @Nullable String httpMethod, @Nullable List<Class<?>> subResources, @Nullable List<ResourceMethodInfo> steps) Create a resource method info object for the call chain (including sub resource locators). -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ResourceMethodInfo other) Apply other method info to this one.This might not be directly called method, but superclass or interface method, where jersey annotations were found (note that jersey does not collect annotations from different places - it expects everything to be configured in one place).getPath()Class<?>Note: for sub-resources it is not required to have rootPathannotation, for such classes here would be the root resource class.getSteps()When sub resources used there would be multiple method callsresource.subResource().method().voidProvided argument without known jersey annotations (assumed to be request body).toString()
-
Constructor Details
-
ResourceMethodInfo
public ResourceMethodInfo(Class<?> resource, String resourcePath, Method method, String path, @Nullable String httpMethod) Create a resource method info object.- Parameters:
resource- resource classresourcePath- resource pathmethod- analyzed methodpath- method pathhttpMethod- http method
-
ResourceMethodInfo
public ResourceMethodInfo(Class<?> resource, String resourcePath, Method method, String path, @Nullable String httpMethod, @Nullable List<Class<?>> subResources, @Nullable List<ResourceMethodInfo> steps) Create a resource method info object for the call chain (including sub resource locators).- Parameters:
resource- resource classresourcePath- resource pathmethod- analyzed methodpath- method pathhttpMethod- http methodsubResources- sub resource classessteps- separate analysis for each method call in the chain
-
-
Method Details
-
getResource
Note: for sub-resources it is not required to have rootPathannotation, for such classes here would be the root resource class.- Returns:
- annotated resource class (where annotations declared)
-
getSubResources
- Returns:
- sub resources or empty if direct resource method
-
getSteps
When sub resources used there would be multiple method callsresource.subResource().method(). In this case, each method call analyzed separately and, in some cases, non-aggregated data might be important (e.g. the only way to properly handle matrix params).- Returns:
- separate methods analysis results for sub resource lookups or empty for single method call
-
getResourcePath
- Returns:
- resource path (without method), resolved from
Pathannotation
-
getMethod
This might not be directly called method, but superclass or interface method, where jersey annotations were found (note that jersey does not collect annotations from different places - it expects everything to be configured in one place).- Returns:
- method with jersey annotations
-
getConsumes
- Returns:
Consumesannotation value from method or class
-
getProduces
- Returns:
Producesannotation value from method or clas
-
getPathParams
- Returns:
- map of not null arguments, passed for
PathParam
-
getQueryParams
- Returns:
- map of not null arguments, passed for
QueryParam
-
getHeaderParams
- Returns:
- map of not null arguments, passed for
HeaderParam
-
getCookieParams
- Returns:
- map of not null arguments, passed for
CookieParam
-
getFormParams
- Returns:
- map of not null arguments, passed for
FormParamorFormDataParam
-
getMatrixParams
- Returns:
- map of not null arguments, passed for
MatrixParam.
-
getPath
- Returns:
- method path, resolved from
Pathannotation
-
getHttpMethod
- Returns:
- http method, resolved from
HttpMethodannotation insideGET,POST, etc.
-
getEntity
- Returns:
- entity object
-
setEntity
Provided argument without known jersey annotations (assumed to be request body).- Parameters:
entity- entity object
-
getFullPath
- Returns:
- full method path (
getResourcePath()withgetPath())
-
apply
Apply other method info to this one.- Parameters:
other- other data
-
toString
-