com.ibm.ccd.ui.validator
Class ValidationHelper
java.lang.Object
com.ibm.ccd.ui.validator.ValidationHelper
- All Implemented Interfaces:
- IValidatorMessage
public class ValidationHelper
- extends java.lang.Object
- implements IValidatorMessage
Fields inherited from interface com.ibm.ccd.ui.validator.IValidatorMessage |
ATTRIBUTE_LIST, ERROR_MESSAGE_LIST, MSG_INVALID_CURRENCY, MSG_INVALID_DATE, MSG_INVALID_FLAG, MSG_INVALID_IMAGE, MSG_INVALID_INTEGER, MSG_INVALID_NUMBER, MSG_INVALID_PERIOD, MSG_INVALID_URL, MSG_MANDATORY_ATTRIBUTE, MSG_MIN_OCCURENCE_ERROR, MSG_MORE_ERRORS, MSG_TOOLTIP |
Method Summary |
static java.lang.String |
createErrorMessage(java.lang.String msgKey,
java.util.Locale locale,
java.lang.Object[] values)
Generate the error message to be stored in the attribute object for display as tooltip |
static java.lang.String |
validateCurrency(java.lang.String attribute,
java.lang.String value,
int precision,
java.util.Locale locale,
MessageMap error)
|
static java.lang.String |
validateDate(java.lang.String attribute,
java.lang.String date,
java.util.Locale locale,
MessageMap error)
|
static java.lang.String |
validateImage(java.lang.String attribute,
java.lang.String image,
java.util.Locale locale,
MessageMap error)
|
static java.lang.String |
validateInteger(java.lang.String attribute,
java.lang.String value,
java.util.Locale locale,
MessageMap error)
|
static java.lang.String |
validateNumber(java.lang.String attribute,
java.lang.String value,
int precision,
java.util.Locale locale,
MessageMap error)
|
static java.lang.String |
validatePeriod(java.lang.String attribute,
java.lang.String fromValue,
java.lang.String toValue,
java.util.Locale locale,
MessageMap error)
|
static java.lang.String |
validateURL(java.lang.String attribute,
java.lang.String url,
java.util.Locale locale,
MessageMap error)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidationHelper
public ValidationHelper()
validateNumber
public static java.lang.String validateNumber(java.lang.String attribute,
java.lang.String value,
int precision,
java.util.Locale locale,
MessageMap error)
- Parameters:
attribute
- Attribute name with the occurence indicator, if anyvalue
- value to be validatedprecision
- maximum number of digits allowed in the fraction portionlocale
- locale of the usererror
- MessageMap in which the error message,if any, is to be added
- Returns:
- a string containing the error message,if any, or null
validateCurrency
public static java.lang.String validateCurrency(java.lang.String attribute,
java.lang.String value,
int precision,
java.util.Locale locale,
MessageMap error)
- Parameters:
attribute
- Attribute name with the occurence indicator, if anyvalue
- value to be validatedprecision
- maximum number of digits allowed in the fraction portionlocale
- locale of the usererror
- MessageMap in which the error message,if any, is to be added
- Returns:
- a string containing the error message,if any, or null
validateInteger
public static java.lang.String validateInteger(java.lang.String attribute,
java.lang.String value,
java.util.Locale locale,
MessageMap error)
- Parameters:
attribute
- Attribute name with the occurence indicator, if anyvalue
- value to be validatedlocale
- locale of the usererror
- MessageMap in which the error message,if any, is to be added
- Returns:
- a string containing the error message,if any, or null
validateDate
public static java.lang.String validateDate(java.lang.String attribute,
java.lang.String date,
java.util.Locale locale,
MessageMap error)
- Parameters:
attribute
- Attribute name with the occurence indicator, if anydate
- value to be validatedlocale
- locale of the usererror
- MessageMap in which the error message,if any, is to be added
- Returns:
- a string containing the error message,if any, or null
validatePeriod
public static java.lang.String validatePeriod(java.lang.String attribute,
java.lang.String fromValue,
java.lang.String toValue,
java.util.Locale locale,
MessageMap error)
- Parameters:
attribute
- Attribute name with the occurence indicator, if anyfromValue
- value of From DatetoValue
- value of To Datelocale
- locale of the usererror
- MessageMap in which the error message,if any, is to be added
- Returns:
- a string containing the error message,if any, or null
validateURL
public static java.lang.String validateURL(java.lang.String attribute,
java.lang.String url,
java.util.Locale locale,
MessageMap error)
- Parameters:
attribute
- Attribute name with the occurence indicator, if anyurl
- url to be validatedlocale
- locale of the usererror
- MessageMap in which the error message,if any, is to be added
- Returns:
- a string containing the error message,if any, or null
validateImage
public static java.lang.String validateImage(java.lang.String attribute,
java.lang.String image,
java.util.Locale locale,
MessageMap error)
- Parameters:
attribute
- Attribute name with the occurence indicator, if anyimage
- value to be validatedlocale
- locale of the usererror
- MessageMap in which the error message,if any, is to be added
- Returns:
- a string containing the error message,if any, or null
createErrorMessage
public static java.lang.String createErrorMessage(java.lang.String msgKey,
java.util.Locale locale,
java.lang.Object[] values)
- Generate the error message to be stored in the attribute object for display as tooltip
- Parameters:
msgKey
- Error message keylocale
- Locale for which the message is to be generatedvalues
- An array of values to be used to format the message
- Returns:
- a string containing the error message to be shown as tooltip on the error image