|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.acsinet_solutions.cetia4.controller.RequestUtils
public class RequestUtils
This class provides useful utility methods for manually reading information from an HTTP request.
Methods in this class may throw validation exceptions. The texts in this class are normally generated using the bundles associated to the com.acsinet_solutions.util.text.GlobalMessages class. Currently spanish and english messages are provided, but new ones may be created under the com.acsinet_solutions.util.text.global_messages bundle. Messages are interpreted when written, for example in ForEachIssueTag, so the messages may be associated to alternative output strings if necessary.
More automatic mapping utilities are provided by the framework using the com.acsinet_solutions.cetia4.controller.map.RequestMapper API.
GlobalMessages,
ForEachIssueTag,
RequestMapper| Constructor Summary | |
|---|---|
RequestUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
filterBigDecimal(java.lang.String value)
Filter undesired characters on BigDecimal input. |
static java.math.BigDecimal |
getBigDecimal(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
Return a valid BigDecimal value from the request. |
static java.math.BigDecimal |
getBigDecimal(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
Return a valid BigDecimal value from the request. |
static java.math.BigDecimal |
getBigDecimal(java.lang.String value,
java.lang.String readableName)
Return a valid BigDecimal value from the request. |
static java.util.Calendar |
getCalendar(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
Return a valid Calendar value from the request |
static java.util.Calendar |
getCalendar(ParameterAccessor request,
java.lang.String dayParam,
java.lang.String monthParam,
java.lang.String yearParam)
Obtain a calendar instance from a request |
static java.util.Calendar |
getCalendar(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
Return a valid Calendar value from the request |
static java.util.Calendar |
getCalendar(javax.servlet.ServletRequest request,
java.lang.String dayParam,
java.lang.String monthParam,
java.lang.String yearParam)
Obtain a calendar instance from a request |
static java.util.Date |
getDate(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
Return a valid Date value from the request. |
static java.util.Date |
getDate(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
Return a valid Date value from the request. |
static int |
getInt(ParameterAccessor request,
java.lang.String parameterName)
Return a valid int value from the request |
static int |
getInt(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
Return a valid int value from the request |
static int |
getInt(javax.servlet.ServletRequest request,
java.lang.String parameterName)
Return a valid int value from the request |
static int |
getInt(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
Return a valid int value from the request |
static int |
getInt(java.lang.String value,
java.lang.String readableName)
Return a valid int value from the given value |
static java.lang.Integer |
getInteger(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
Return a valid maybe-null Integer value from the request |
static java.lang.Integer |
getInteger(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
Return a valid not-null Integer value from the request |
static java.lang.Integer |
getInteger(java.lang.String value,
java.lang.String readableName)
Return a valid maybe-null Integer value from the request |
static java.util.Calendar |
getNotNullCalendar(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
Return a valid Calendar value from the request |
static java.util.Calendar |
getNotNullCalendar(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
Return a valid not null Calendar value from the request |
static java.lang.Integer |
getNotNullInteger(ParameterAccessor request,
java.lang.String parameterName)
Return a valid not-null Integer value from the request |
static java.lang.Integer |
getNotNullInteger(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
Return a valid not-null Integer value from the request |
static java.lang.Integer |
getNotNullInteger(javax.servlet.ServletRequest request,
java.lang.String parameterName)
Return a valid not-null Integer value from the request |
static java.lang.Integer |
getNotNullInteger(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
Return a valid maybe-null Integer value from the request |
static java.lang.Integer |
getNotNullInteger(java.lang.String value,
java.lang.String readableName)
Return a valid not-null Integer value from the request |
static java.lang.String |
getNotNullString(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
Return a not-null String value from the request |
static java.lang.String |
getNotNullString(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
Return a not-null String value from the request |
static java.lang.String |
getNotNullString(java.lang.String value,
java.lang.String readableName)
Return a not-null String value from a string. |
static void |
setDefaultBigDecimalFilterCharacters(java.lang.String chars)
Set the default filter characters for the big decimal mapping performed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RequestUtils()
| Method Detail |
|---|
public static void setDefaultBigDecimalFilterCharacters(java.lang.String chars)
throws SyntaxException
SyntaxException - Thrown if a regultar expression for the given
characters could not be created.ControllerTools.initLocaleAndBundle(ServletContext)public static java.lang.String filterBigDecimal(java.lang.String value)
public static java.lang.String getNotNullString(java.lang.String value,
java.lang.String readableName)
throws ValidationException
value - A maybe-null String value
ValidationException
public static java.lang.String getNotNullString(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static java.lang.String getNotNullString(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static java.lang.Integer getNotNullInteger(java.lang.String value,
java.lang.String readableName)
throws ValidationException
ValidationException
public static java.lang.Integer getNotNullInteger(javax.servlet.ServletRequest request,
java.lang.String parameterName)
throws ValidationException
ValidationException
public static java.lang.Integer getNotNullInteger(ParameterAccessor request,
java.lang.String parameterName)
throws ValidationException
ValidationException
public static java.lang.Integer getInteger(java.lang.String value,
java.lang.String readableName)
throws ValidationException
ValidationException
public static java.lang.Integer getInteger(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static java.lang.Integer getInteger(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static java.lang.Integer getNotNullInteger(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static java.lang.Integer getNotNullInteger(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static int getInt(java.lang.String value,
java.lang.String readableName)
throws ValidationException
ValidationException
public static int getInt(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static int getInt(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static int getInt(javax.servlet.ServletRequest request,
java.lang.String parameterName)
throws ValidationException
ValidationException
public static int getInt(ParameterAccessor request,
java.lang.String parameterName)
throws ValidationException
ValidationException
public static java.util.Calendar getNotNullCalendar(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
throws ValidationException
ValidationException
public static java.util.Calendar getNotNullCalendar(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
throws ValidationException
ValidationException
public static java.util.Calendar getCalendar(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
throws ValidationException
ValidationException
public static java.util.Calendar getCalendar(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
throws ValidationException
ValidationException
public static final java.util.Calendar getCalendar(javax.servlet.ServletRequest request,
java.lang.String dayParam,
java.lang.String monthParam,
java.lang.String yearParam)
throws ValidationException
request - A not-null HttpServletRequest instancedayParam - A not-null not-empty String representing
the day parametermonthParam - A not-null not-empty String representing
the month parameteryearParam - A not-null not-empty String representing
the year parameter
ValidationException
public static final java.util.Calendar getCalendar(ParameterAccessor request,
java.lang.String dayParam,
java.lang.String monthParam,
java.lang.String yearParam)
throws ValidationException
request - A not-null HttpServletRequest instancedayParam - A not-null not-empty String representing
the day parametermonthParam - A not-null not-empty String representing
the month parameteryearParam - A not-null not-empty String representing
the year parameter
ValidationException
public static java.util.Date getDate(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
throws ValidationException
ValidationException
public static java.util.Date getDate(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName,
java.text.DateFormat format)
throws ValidationException
ValidationException
public static java.math.BigDecimal getBigDecimal(javax.servlet.ServletRequest request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static java.math.BigDecimal getBigDecimal(ParameterAccessor request,
java.lang.String parameterName,
java.lang.String readableName)
throws ValidationException
ValidationException
public static java.math.BigDecimal getBigDecimal(java.lang.String value,
java.lang.String readableName)
throws ValidationException
ValidationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||