|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.plugins.rest.service.param.AbstractParam<V>
V - the real object classpublic abstract class AbstractParam<V>
Provides simple param parsing. Implementations have to override parse(String) to transform the String to a concrete V object.
| Constructor Summary | |
|---|---|
AbstractParam(String strParam)
Builds this param and calls parse(String) |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractParam(String strParam)
throws javax.ws.rs.WebApplicationException
parse(String)
strParam - the param to parse
javax.ws.rs.WebApplicationException - if an exception occured, with preconfigured message getErrorMessage(String, Throwable)| Method Detail |
|---|
public V getValue()
getOriginalParam()
public String getOriginalParam()
public String toString()
toString in class Object
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 exception
protected String getErrorMessage(String strParam,
Throwable e)
strParam - string to parsee - error to handle
protected abstract V parse(String strParam)
throws Throwable
strParam - the string to parse
Throwable - if occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||