public abstract class RestMethodParam extends Object
Used to resolve instances of classes being passed to Java REST methods.
By default, the following parameter types can be passed into Java methods in any order:
HttpServletRequest
RestRequest
HttpServletResponse
RestResponse
Config
HttpMethod
InputStream
Locale
MessageBundle
OutputStream
Parser
Reader
RequestBody
RequestFormData
RequestHeaders
RequestPath
RequestQuery
ResourceBundle
RestContext
RestLogger
RequestProperties
ServletInputStream
ServletOutputStream
Swagger
UriContext
UriResolver
Writer
Modifier | Constructor and Description |
---|---|
protected |
RestMethodParam(RestParamType paramType,
Method method,
int index)
Constructor.
|
protected |
RestMethodParam(RestParamType paramType,
Method method,
int index,
String name)
Constructor.
|
protected |
RestMethodParam(RestParamType paramType,
Method method,
int index,
String name,
Type type)
Constructor.
|
protected |
RestMethodParam(RestParamType paramType,
String name,
Type type)
Constructor.
|
protected |
RestMethodParam(RestParamType paramType,
Type type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Class<?> |
forClass()
Returns the parameter class type that this parameter resolver is meant for.
|
protected String |
getName()
Returns the parameter name for this parameter as shown in the Swagger doc.
|
protected RestParamType |
getParamType()
Returns the swagger parameter type for this parameter as shown in the Swagger doc.
|
Type |
getType()
Returns the parameter class type.
|
Class<?> |
getTypeClass()
Returns the parameter class type.
|
abstract Object |
resolve(RestRequest req,
RestResponse res)
Resolves the parameter object.
|
protected RestMethodParam(RestParamType paramType, Method method, int index, String name, Type type)
paramType
- The Swagger parameter type.method
- The method on which the parameter resides.index
- The method parameter index.name
- The parameter name.
Can be type
- The object type to convert the parameter to.protected RestMethodParam(RestParamType paramType, Method method, int index, String name)
paramType
- The Swagger parameter type.method
- The method on which the parameter resides.index
- The method parameter index.name
- The parameter name.
Can be protected RestMethodParam(RestParamType paramType, Method method, int index)
paramType
- The Swagger parameter type.method
- The method on which the parameter resides.index
- The method parameter index.protected RestMethodParam(RestParamType paramType, Type type)
paramType
- The Swagger parameter type.type
- The object type to convert the parameter to.protected RestMethodParam(RestParamType paramType, String name, Type type)
paramType
- The Swagger parameter type.name
- The parameter name.
Can be type
- The object type to convert the parameter to.public abstract Object resolve(RestRequest req, RestResponse res) throws Exception
req
- The rest request.res
- The rest response.Exception
protected Class<?> forClass()
Class
.protected RestParamType getParamType()
protected String getName()
public Class<?> getTypeClass()
Copyright © 2018 Apache. All rights reserved.