V
- the real object classpublic abstract class AbstractParam<V> extends Object
parse(String)
to transform the String to a concrete V object.Constructor and Description |
---|
AbstractParam(String strParam)
Builds this param and calls
parse(String) |
Modifier and Type | Method and Description |
---|---|
protected String |
getErrorMessage(String strParam,
Throwable e)
Gets an error message
|
String |
getOriginalParam()
Gets the original string param
|
V |
getValue()
The value of the string
getOriginalParam() |
protected javax.ws.rs.core.Response |
onError(String strParam,
Throwable e)
Builds a reponse when an error occurs with
Response.Status.BAD_REQUEST as http status. |
protected abstract V |
parse(String strParam)
Parse the string to its real value
|
String |
toString() |
public AbstractParam(String strParam) throws javax.ws.rs.WebApplicationException
parse(String)
strParam
- the param to parsejavax.ws.rs.WebApplicationException
- if an exception occured, with preconfigured message getErrorMessage(String, Throwable)
public V getValue()
getOriginalParam()
public String getOriginalParam()
protected javax.ws.rs.core.Response onError(String strParam, Throwable e)
Response.Status.BAD_REQUEST
as http status.strParam
- the string causing the errore
- the exceptionprotected String getErrorMessage(String strParam, Throwable e)
strParam
- string to parsee
- error to handleCopyright © 2021 City of Paris. All rights reserved.