|
Version 3.10.0
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objecthirondelle.web4j.model.ConvertParamImpl
public class ConvertParamImpl
Default implementation of ConvertParam.
| Constructor Summary | |
|---|---|
ConvertParamImpl()
|
|
| Method Summary | ||
|---|---|---|
|
convert(String aFilteredInputValue,
Class<T> aSupportedTargetClass,
Locale aLocale,
TimeZone aTimeZone)
Apply reasonable parsing policies, suitable for most applications. |
|
String |
filter(String aRawInputValue)
Coerce all parameters with no visible content to null. |
|
static String |
getIgnorableParamValue()
Return the IgnorableParamValue configured in web.xml. |
|
static void |
init(ServletConfig aConfig)
Called by the framework upon startup. |
|
boolean |
isSupported(Class<?> aTargetClass)
Return true only if aTargetClass is supported by this implementation. |
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConvertParamImpl()
| Method Detail |
|---|
public static void init(ServletConfig aConfig)
public final boolean isSupported(Class<?> aTargetClass)
The following classes are supported by this implementation as building block classes :
SafeText
Decimal
Id
String is supported only when explicitly allowed.
The AllowStringAsBuildingBlock setting in web.xml
controls whether or not this class allows String as a supported class.
By default, its value is FALSE, since SafeText is the recommended
replacement for String.
isSupported in interface ConvertParampublic String filter(String aRawInputValue)
In addition, any raw input value that matches IgnorableParamValue in web.xml is also coerced to null. See web.xml for more information.
Any non-null result is trimmed. This method can be overridden, if desired.
filter in interface ConvertParamaRawInputValue - the raw, unchanged parameter value, as submitted in the underlying request.
public final <T> T convert(String aFilteredInputValue,
Class<T> aSupportedTargetClass,
Locale aLocale,
TimeZone aTimeZone)
throws ModelCtorException
Roughly, the policies are :
SafeText.SafeText(String)
Integer.Integer(String)
Formats.getDecimalInputFormat()
Formats.getDecimalInputFormat()
Util.parseBoolean(String)
DateConverter.parseEyeFriendly(String, Locale, TimeZone)
and DateConverter.parseHandFriendly(String, Locale, TimeZone)
Long.Long(String)
Id.Id(String)
Util.buildLocale(String)
Util.buildTimeZone(String)
convert in interface ConvertParamaFilteredInputValue - parameter value as returned by ConvertParam.filter(String)aSupportedTargetClass - supported target building block class in a Model Object constructoraLocale - Locale returned by the implementation of LocaleSourceaTimeZone - TimeZone returned by the implementation of TimeZoneSource
ModelCtorExceptionpublic static final String getIgnorableParamValue()
|
Version 3.10.0
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||