|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.data.validator.AbstractValidator<java.lang.String>
com.vaadin.data.validator.AbstractStringValidator
com.vaadin.data.validator.StringLengthValidator
public class StringLengthValidator
This StringLengthValidator
is used to validate the length of
strings.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vaadin.data.Validator |
---|
Validator.EmptyValueException, Validator.InvalidValueException |
Constructor Summary | |
---|---|
StringLengthValidator(java.lang.String errorMessage)
Creates a new StringLengthValidator with a given error message. |
|
StringLengthValidator(java.lang.String errorMessage,
java.lang.Integer minLength,
java.lang.Integer maxLength,
boolean allowNull)
Creates a new StringLengthValidator with a given error message and minimum and maximum length limits. |
Method Summary | |
---|---|
java.lang.Integer |
getMaxLength()
Gets the maximum permissible length of the string. |
java.lang.Integer |
getMinLength()
Gets the minimum permissible length of the string. |
boolean |
isNullAllowed()
Deprecated. |
protected boolean |
isValidValue(java.lang.String value)
Checks if the given value is valid. |
void |
setMaxLength(java.lang.Integer maxLength)
Sets the maximum permissible length of the string. |
void |
setMinLength(java.lang.Integer minLength)
Sets the minimum permissible length. |
void |
setNullAllowed(boolean allowNull)
Deprecated. |
Methods inherited from class com.vaadin.data.validator.AbstractStringValidator |
---|
getType |
Methods inherited from class com.vaadin.data.validator.AbstractValidator |
---|
getErrorMessage, isValid, isValidType, setErrorMessage, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringLengthValidator(java.lang.String errorMessage)
errorMessage
- the message to display in case the value does not validate.public StringLengthValidator(java.lang.String errorMessage, java.lang.Integer minLength, java.lang.Integer maxLength, boolean allowNull)
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 |
---|
protected boolean isValidValue(java.lang.String value)
isValidValue
in class AbstractValidator<java.lang.String>
value
- the value to validate.
true
for valid value, otherwise false
.@Deprecated public final boolean isNullAllowed()
true
if null strings are allowed.
true
if allows null string, otherwise
false
.public java.lang.Integer getMaxLength()
public java.lang.Integer getMinLength()
@Deprecated public void setNullAllowed(boolean allowNull)
public void setMaxLength(java.lang.Integer maxLength)
maxLength
- the maximum length to accept or null for no limitpublic void setMinLength(java.lang.Integer minLength)
minLength
- the minimum length to accept or null for no limit
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |