public class ParameterValidationUtil
extends java.lang.Object
PARAM_TYPE_DATETIME
PARAM_TYPE_FLOAT
PARAM_TYPE_DECIMAL
PARAM_TYPE_BOOLEAN
PARAM_TYPE_STRING
PARAM_TYPE_INTEGER
PARAM_TYPE_DATE
PARAM_TYPE_TIME
DesignChoiceConstants
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DATE_FORMAT |
static java.lang.String |
DEFAULT_DATETIME_FORMAT
Default date-time format string.
|
static java.lang.String |
DEFAULT_TIME_FORMAT |
static java.lang.String |
DISPLAY_DATE_FORMAT |
static java.lang.String |
DISPLAY_TIME_FORMAT |
Constructor and Description |
---|
ParameterValidationUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getDisplayValue(java.lang.Object value)
Gets the display string for the value with default locale and default
format, The value must be the valid data type.
|
static java.lang.String |
getDisplayValue(java.lang.Object value,
TimeZone timeZone)
Gets the display string for the value with default locale and default
format, The value must be the valid data type.
|
static java.lang.String |
getDisplayValue(java.lang.String dataType,
java.lang.String format,
java.lang.Object value)
Gets the display string for the value with the given data type, format
and the default locale defined by the class(Locale.US).
|
static java.lang.String |
getDisplayValue(java.lang.String dataType,
java.lang.String format,
java.lang.Object value,
java.util.Locale locale)
Gets the display string for the value with the given data type, format,
locale.
|
static java.lang.String |
getDisplayValue(java.lang.String dataType,
java.lang.String format,
java.lang.Object value,
ULocale locale)
Gets the display string for the value with the given data type, format,
locale.
|
static java.lang.String |
getDisplayValue(java.lang.String dataType,
java.lang.String format,
java.lang.Object value,
ULocale locale,
TimeZone timeZone)
Gets the display string for the value with the given data type, format,
locale.
|
static java.lang.Object |
validate(java.lang.String dataType,
java.lang.String format,
java.lang.String value,
java.util.Locale locale,
TimeZone timeZone)
Validates a input parameter value with the given data type, format choice
string.
|
static java.lang.Object |
validate(java.lang.String dataType,
java.lang.String format,
java.lang.String value,
TimeZone timeZone)
Validates a input parameter value with the given data type, format choice
string, using the default locale.
|
static java.lang.Object |
validate(java.lang.String dataType,
java.lang.String format,
java.lang.String value,
ULocale locale)
Validates a input parameter value with the given data type, format choice
string.
|
static java.lang.Object |
validate(java.lang.String dataType,
java.lang.String format,
java.lang.String value,
ULocale locale,
TimeZone timeZone)
Validates a input parameter value with the given data type, format choice
string.
|
public static final java.lang.String DEFAULT_DATETIME_FORMAT
public static final java.lang.String DEFAULT_DATE_FORMAT
public static final java.lang.String DEFAULT_TIME_FORMAT
public static final java.lang.String DISPLAY_DATE_FORMAT
public static final java.lang.String DISPLAY_TIME_FORMAT
public static java.lang.Object validate(java.lang.String dataType, java.lang.String format, java.lang.String value, java.util.Locale locale, TimeZone timeZone) throws ValidationValueException
Data Type | Format Type |
Float/Decimal |
|
Date time |
|
String |
|
dataType
- the data type of the valueformat
- the format choice stringvalue
- the input value to validatelocale
- the locale informationtimeZone
- the time zone informationValidationValueException
- if the input value is not valid with the given data type and
format stringpublic static java.lang.Object validate(java.lang.String dataType, java.lang.String format, java.lang.String value, TimeZone timeZone) throws ValidationValueException
Data Type | Format Type |
Float/Decimal |
|
Date time |
|
String |
|
dataType
- the data type of the valueformat
- the format choice stringvalue
- the input value to validatetimeZone
- the time zone informationValidationValueException
- if the input value is not valid with the given data type and
format stringpublic static java.lang.Object validate(java.lang.String dataType, java.lang.String format, java.lang.String value, ULocale locale) throws ValidationValueException
Data Type | Format Type |
Float/Decimal |
|
Date time |
|
String |
|
dataType
- the data type of the valueformat
- the format choice stringvalue
- the input value to validatelocale
- the locale informationValidationValueException
- if the input value is not valid with the given data type and
format stringpublic static java.lang.Object validate(java.lang.String dataType, java.lang.String format, java.lang.String value, ULocale locale, TimeZone timeZone) throws ValidationValueException
Data Type | Format Type |
Float/Decimal |
|
Date time |
|
String |
|
dataType
- the data type of the valueformat
- the format choice stringvalue
- the input value to validatelocale
- the locale informationtimeZone
- the time zone information (only valid for DateTime type)ValidationValueException
- if the input value is not valid with the given data type and
format stringpublic static java.lang.String getDisplayValue(java.lang.String dataType, java.lang.String format, java.lang.Object value, java.util.Locale locale)
PARAM_TYPE_DATETIME
, then the value must
be java.util.Date.
PARAM_TYPE_FLOAT
, then the value
must be java.lang.Double
.PARAM_TYPE_DECIMAL
, then the value
must be java.math.BigDecimal
.PARAM_TYPE_BOOLEAN
, then the value
must be java.lang.Boolean
.PARAM_TYPE_STRING
, then the value
must be java.lang.String
.dataType
- the data type of the input valueformat
- the format pattern to validatevalue
- the input value to validatelocale
- the locale informationpublic static java.lang.String getDisplayValue(java.lang.Object value)
PARAM_TYPE_DATETIME
, then the value must
be java.util.Date.
PARAM_TYPE_FLOAT
, then the value
must be java.lang.Double
.PARAM_TYPE_DECIMAL
, then the value
must be java.math.BigDecimal
.PARAM_TYPE_BOOLEAN
, then the value
must be java.lang.Boolean
.PARAM_TYPE_STRING
, then the value
must be java.lang.String
.value
- the input value to validatepublic static java.lang.String getDisplayValue(java.lang.Object value, TimeZone timeZone)
PARAM_TYPE_DATETIME
, then the value must
be java.util.Date.
PARAM_TYPE_FLOAT
, then the value
must be java.lang.Double
.PARAM_TYPE_DECIMAL
, then the value
must be java.math.BigDecimal
.PARAM_TYPE_BOOLEAN
, then the value
must be java.lang.Boolean
.PARAM_TYPE_STRING
, then the value
must be java.lang.String
.value
- the input value to validatetimeZone
- the time zone to use (only for DateTime type)public static java.lang.String getDisplayValue(java.lang.String dataType, java.lang.String format, java.lang.Object value, ULocale locale)
PARAM_TYPE_DATETIME
, then the value must
be java.util.Date.
PARAM_TYPE_FLOAT
, then the value
must be java.lang.Double
.PARAM_TYPE_DECIMAL
, then the value
must be java.math.BigDecimal
.PARAM_TYPE_BOOLEAN
, then the value
must be java.lang.Boolean
.PARAM_TYPE_STRING
, then the value
must be java.lang.String
.dataType
- the data type of the input valueformat
- the format pattern to validatevalue
- the input value to validatelocale
- the locale informationpublic static java.lang.String getDisplayValue(java.lang.String dataType, java.lang.String format, java.lang.Object value, ULocale locale, TimeZone timeZone)
PARAM_TYPE_DATETIME
, then the value must
be java.util.Date.
PARAM_TYPE_FLOAT
, then the value
must be java.lang.Double
.PARAM_TYPE_DECIMAL
, then the value
must be java.math.BigDecimal
.PARAM_TYPE_BOOLEAN
, then the value
must be java.lang.Boolean
.PARAM_TYPE_STRING
, then the value
must be java.lang.String
.dataType
- the data type of the input valueformat
- the format pattern to validatevalue
- the input value to validatelocale
- the locale informationpublic static java.lang.String getDisplayValue(java.lang.String dataType, java.lang.String format, java.lang.Object value)
PARAM_TYPE_DATETIME
, then the value must
be java.util.Date.
PARAM_TYPE_FLOAT
, then the value
must be java.lang.Double
.PARAM_TYPE_DECIMAL
, then the value
must be java.math.BigDecimal
.PARAM_TYPE_BOOLEAN
, then the value
must be java.lang.Boolean
.PARAM_TYPE_STRING
, then the value
must be java.lang.String
.dataType
- the data type of the input valueformat
- the format pattern to validatevalue
- the input value to validateCopyright © 2014 OpenText Corp. All rights reserved.