public abstract class DataObjectEncodingUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DATE_FORMAT |
static String |
DATE_STRING |
static String |
ODBC_POSTFIX |
static String |
ODBC_PREFIX |
Constructor and Description |
---|
DataObjectEncodingUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addLocaleInfo(DataBinder dataBinder)
Add the localization information into the databinder
|
static Calendar |
decodeDate(String dateString)
Parse the date from the encoded string.
|
static String |
encodeDate(Date date)
Encode the date in the standard iso8601 date format
|
static boolean |
getBoolean(DataObject dataObject,
String name,
boolean defaultValue)
Retrieve the result as a boolean
|
static Calendar |
getCalendar(DataObject dataObject,
String name)
Retrieve the getCalendar.
|
static int |
getInteger(DataObject dataObject,
String name,
int defaultValue)
Retrieve an integer from the DataObject
|
static long |
getLong(DataObject dataObject,
String name,
long defaultValue)
Retrieve an long from the DataObject
|
static Protocol.NullHandlingStrategy |
getNullHandlingStrategyFromBinder(DataBinder dataBinder,
boolean removeIdcNullHandlingParamFromBinderWhenDone)
Get the null value handling strategy from the databinder
By default, we will treat the null value as empty string should an
explicit handling strategy not be specified
|
static void |
setBoolean(DataObject dataObject,
String name,
boolean value)
Set a value as a boolean
|
static void |
setDate(DataObject dataObject,
String name,
Date date)
Set a date value.
|
public static final String ODBC_PREFIX
public static final String ODBC_POSTFIX
public static final String DATE_FORMAT
public static final String DATE_STRING
public static void addLocaleInfo(DataBinder dataBinder)
dataBinder
- the databinderpublic static Protocol.NullHandlingStrategy getNullHandlingStrategyFromBinder(DataBinder dataBinder, boolean removeIdcNullHandlingParamFromBinderWhenDone)
dataBinder
- the databinderremoveIdcNullHandlingParamFromBinderWhenDone
- whether to remove the param from the databinder when done (preventing it getting sent to the Content Server)public static boolean getBoolean(DataObject dataObject, String name, boolean defaultValue)
dataObject
- the data objectname
- the property namedefaultValue
- the default value if not foundpublic static void setBoolean(DataObject dataObject, String name, boolean value)
dataObject
- the data objectname
- the property namevalue
- the property valuepublic static int getInteger(DataObject dataObject, String name, int defaultValue)
dataObject
- the data objectname
- the property namedefaultValue
- the default value if not foundpublic static long getLong(DataObject dataObject, String name, long defaultValue)
dataObject
- the data objectname
- the property namedefaultValue
- the default value if not foundpublic static void setDate(DataObject dataObject, String name, Date date)
dataObject
- the data objectname
- the property namedate
- the date in GMT timepublic static Calendar getCalendar(DataObject dataObject, String name)
dataObject
- the data objectname
- the property namepublic static String encodeDate(Date date)
date
- the datepublic static Calendar decodeDate(String dateString) throws ParseException
dateString
- the encoded dateParseException