public abstract class TextInputValidator extends RegexValidator
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
BLANK_PATTERN
Regular expression for blank input (containing only spaces).
|
static java.lang.String |
CHECK_BLANK_MESSAGE
Default message for the validator.
|
static java.lang.String |
CHECK_EMPTY_MESSAGE
Default message for the validator.
|
static java.lang.String |
CHECK_MAX_LENGTH_MESSAGE |
static java.lang.String |
CHECK_NOT_BLANK_MESSAGE
Default message for the validator.
|
static java.lang.String |
CHECK_NOT_EMPTY_MESSAGE
Default message for the validator.
|
static java.lang.String |
CHECK_NUMBER_MESSAGE
Default message for the validator.
|
private static java.lang.String |
NUMBER_PATTERN
Regular expression for matching number.
|
CHECK_REGEX_MESSAGE
Modifier | Constructor and Description |
---|---|
protected |
TextInputValidator(java.lang.String aValue)
Creates new instance of validator.
|
Modifier and Type | Method and Description |
---|---|
static TextInputValidator |
checkBlank(java.lang.String aValue)
Valides blank value.
|
static TextInputValidator |
checkEmpty(java.lang.String aValue)
Valides empty value.
|
static TextInputValidator |
checkMaxLength(java.lang.String value,
Validates maximum string length.
|
static TextInputValidator |
checkNotBlank(java.lang.String aValue)
Valides blank value.
|
static TextInputValidator |
checkNotEmpty(java.lang.String aValue)
Valides empty value.
|
static TextInputValidator |
checkNumber(java.lang.String aValue)
Valides number format.
|
protected boolean |
validateBlank()
Checks if value is blank.
|
protected boolean |
validateEmpty()
Checks if value is empty.
|
protected boolean |
validateMaxLength(int maxLength)
Checks if the value's character count does not exceed the specified count.
|
protected boolean |
validateNotBlank()
Checks if value is not blank.
|
protected boolean |
validateNotEmpty()
Checks if value is not empty.
|
protected boolean |
validateNumber()
Checks if value is valid number.
|
getRegex, getValue, checkRegex, isValid, setRegex, setValue
getMessage, setMessage, validate
aValue
- Value to be checkedaValue
- Text to be evaluatedaValue
- Text to be evaluatedaValue
- Text to be evaluatedaValue
- Text to be evaluatedaValue
- Text to be evaluatedtrue
if the character count is less than or equal
to the specified value.value
- text to be validated.maxLength
- maximum allowed characters count.maxLength
- maximum allowed characters count.true
if the character count is less than or equal to the specified value; false
otherwise