public class HttpParametersLoaderImpl<T> extends Object implements HttpParametersLoader<T>
HttpParametersLoader
implementation.Constructor and Description |
---|
HttpParametersLoaderImpl() |
Modifier and Type | Method and Description |
---|---|
void |
init(Class<T> type,
Map<String,String> aliasMappings,
boolean isCaseInsensitive,
ObjectInstantiator objectInstantiator)
Initialises this
HttpParametersLoader . |
<O extends T> |
loadParameters(HttpRequest httpRequest,
O object)
Loads the parameters of the
HttpRequest to the Object. |
public void init(Class<T> type, Map<String,String> aliasMappings, boolean isCaseInsensitive, ObjectInstantiator objectInstantiator) throws Exception
HttpParametersLoader
HttpParametersLoader
.init
in interface HttpParametersLoader<T>
type
- Type of object to be loaded (and may be an interface). The
type is interrogated for
public void setXxx(String value)
methods for
loading corresponding parameters. The property name of each
method is the method name stripped of the leading
set
.aliasMappings
- Alias mappings so HttpRequest
parameter names need not
match exactly the Object method property names.isCaseInsensitive
- Flag indicating if matching on parameter names is to be case
sensitive. Specifying false
results in matching
names ignoring case - which makes for more tolerable loading.objectInstantiator
- ObjectInstantiator
.Exception
- If fails to initialise.public <O extends T> void loadParameters(HttpRequest httpRequest, O object) throws IOException, HttpParametersException
HttpParametersLoader
HttpRequest
to the Object.loadParameters
in interface HttpParametersLoader<T>
O
- Object type.httpRequest
- HttpRequest
to extract the parameters.object
- Object to be loaded with the parameters.IOException
- If fails to read data from the HttpRequest
.HttpParametersException
- If fails to load the HttpRequest
parameters to the
Object.Copyright © 2005–2016. All rights reserved.