Class AbstractStringValidator
java.lang.Object
com.vaadin.featurepack.data.validator.AbstractValidator<String>
com.vaadin.featurepack.data.validator.AbstractStringValidator
- All Implemented Interfaces:
Validator,Serializable
- Direct Known Subclasses:
RegexpValidator,StringLengthValidator
Validator base class for validating strings.
To include the value that failed validation in the exception message you can
use "{0}" in the error message. This will be replaced with the failed value
(converted to string using Object.toString()) or "null" if the value is
null.
- Author:
- Vaadin Ltd.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.featurepack.data.Validator
Validator.EmptyValueException, Validator.InvalidValueException -
Constructor Summary
ConstructorsConstructorDescriptionAbstractStringValidator(String errorMessage) Constructs a validator for strings. -
Method Summary
Methods inherited from class com.vaadin.featurepack.data.validator.AbstractValidator
getErrorMessage, isValid, isValidType, isValidValue, setErrorMessage, validate
-
Constructor Details
-
AbstractStringValidator
Constructs a validator for strings.Null and empty string values are always accepted. To reject empty values, set the field being validated as required.
- Parameters:
errorMessage- the message to be included in anValidator.InvalidValueException(with "{0}" replaced by the value that failed validation).
-
-
Method Details
-
getType
- Specified by:
getTypein classAbstractValidator<String>
-