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:
Modifier | Constructor and Description |
---|---|
protected |
RestMethodParam(RestParamType paramType,
ClassInfo type)
Constructor.
|
protected |
RestMethodParam(RestParamType paramType,
ParamInfo mpi)
Constructor.
|
protected |
RestMethodParam(RestParamType paramType,
ParamInfo mpi,
String name)
Constructor.
|
protected |
RestMethodParam(RestParamType paramType,
ParamInfo mpi,
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.
|
ParamInfo |
getMethodParamInfo()
Returns the parameter info.
|
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, ParamInfo mpi, String name, Type type)
paramType
- The Swagger parameter type.mpi
- The method parameter.name
- The parameter name.
Can be type
- The object type to convert the parameter to.protected RestMethodParam(RestParamType paramType, ParamInfo mpi, String name)
paramType
- The Swagger parameter type.mpi
- The method parameter.name
- The parameter name.
Can be protected RestMethodParam(RestParamType paramType, ParamInfo mpi)
paramType
- The Swagger parameter type.mpi
- The method parameter.protected RestMethodParam(RestParamType paramType, Type type)
paramType
- The Swagger parameter type.type
- The object type to convert the parameter to.protected RestMethodParam(RestParamType paramType, ClassInfo 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
- Generic error occurred.protected Class<?> forClass()
Class
.protected RestParamType getParamType()
public ParamInfo getMethodParamInfo()
protected String getName()
public Class<?> getTypeClass()
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.