Package com.vaadin.v7.data.validator
Class StringLengthValidator
- java.lang.Object
-
- com.vaadin.v7.data.validator.AbstractValidator<String>
-
- com.vaadin.v7.data.validator.AbstractStringValidator
-
- com.vaadin.v7.data.validator.StringLengthValidator
-
- All Implemented Interfaces:
Validator,Serializable
@Deprecated public class StringLengthValidator extends AbstractStringValidator
Deprecated.ThisStringLengthValidatoris used to validate the length of strings.- Since:
- 3.0
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.v7.data.Validator
Validator.EmptyValueException, Validator.InvalidValueException
-
-
Constructor Summary
Constructors Constructor Description StringLengthValidator(String errorMessage)Deprecated.Creates a new StringLengthValidator with a given error message.StringLengthValidator(String errorMessage, Integer minLength, Integer maxLength, boolean allowNull)Deprecated.Creates a new StringLengthValidator with a given error message and minimum and maximum length limits.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IntegergetMaxLength()Deprecated.Gets the maximum permissible length of the string.IntegergetMinLength()Deprecated.Gets the minimum permissible length of the string.booleanisNullAllowed()Deprecated.protected booleanisValidValue(String value)Deprecated.Checks if the given value is valid.voidsetMaxLength(Integer maxLength)Deprecated.Sets the maximum permissible length of the string.voidsetMinLength(Integer minLength)Deprecated.Sets the minimum permissible length.voidsetNullAllowed(boolean allowNull)Deprecated.-
Methods inherited from class com.vaadin.v7.data.validator.AbstractStringValidator
getType
-
Methods inherited from class com.vaadin.v7.data.validator.AbstractValidator
getErrorMessage, isValid, isValidType, setErrorMessage, validate
-
-
-
-
Constructor Detail
-
StringLengthValidator
public StringLengthValidator(String errorMessage)
Deprecated.Creates a new StringLengthValidator with a given error message.- Parameters:
errorMessage- the message to display in case the value does not validate.
-
StringLengthValidator
public StringLengthValidator(String errorMessage, Integer minLength, Integer maxLength, boolean allowNull)
Deprecated.Creates a new StringLengthValidator with a given error message and minimum and maximum length limits.- Parameters:
errorMessage- the message to display in case the value does not validate.minLength- the minimum permissible length of the string or null for no limit. A negative value for no limit is also supported for backwards compatibility.maxLength- the maximum permissible length of the string or null for no limit. A negative value for no limit is also supported for backwards compatibility.allowNull- Are null strings permissible? This can be handled better by setting a field as required or not.
-
-
Method Detail
-
isValidValue
protected boolean isValidValue(String value)
Deprecated.Checks if the given value is valid.- Specified by:
isValidValuein classAbstractValidator<String>- Parameters:
value- the value to validate.- Returns:
truefor valid value, otherwisefalse.
-
isNullAllowed
@Deprecated public final boolean isNullAllowed()
Deprecated.Returnstrueif null strings are allowed.- Returns:
trueif allows null string, otherwisefalse.
-
getMaxLength
public Integer getMaxLength()
Deprecated.Gets the maximum permissible length of the string.- Returns:
- the maximum length of the string or null if there is no limit
-
getMinLength
public Integer getMinLength()
Deprecated.Gets the minimum permissible length of the string.- Returns:
- the minimum length of the string or null if there is no limit
-
setNullAllowed
@Deprecated public void setNullAllowed(boolean allowNull)
Deprecated.Sets whether null-strings are to be allowed. This can be better handled by setting a field as required or not.
-
setMaxLength
public void setMaxLength(Integer maxLength)
Deprecated.Sets the maximum permissible length of the string.- Parameters:
maxLength- the maximum length to accept or null for no limit
-
setMinLength
public void setMinLength(Integer minLength)
Deprecated.Sets the minimum permissible length.- Parameters:
minLength- the minimum length to accept or null for no limit
-
-