|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.data.validator.NullValidator
public class NullValidator
This validator is used for validating properties that do or do not allow null values. By default, nulls are not allowed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vaadin.data.Validator |
---|
Validator.EmptyValueException, Validator.InvalidValueException |
Constructor Summary | |
---|---|
NullValidator(String errorMessage,
boolean onlyNullAllowed)
Creates a new NullValidator. |
Method Summary | |
---|---|
String |
getErrorMessage()
Gets the error message that is displayed in case the value is invalid. |
boolean |
isNullAllowed()
Returns true if nulls are allowed otherwise
false . |
void |
setErrorMessage(String errorMessage)
Sets the error message to be displayed on invalid value. |
void |
setNullAllowed(boolean onlyNullAllowed)
Sets if nulls (and only nulls) are to be allowed. |
void |
validate(Object value)
Validates the data given in value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NullValidator(String errorMessage, boolean onlyNullAllowed)
errorMessage
- the error message to display on invalidation.onlyNullAllowed
- Are only nulls allowed?Method Detail |
---|
public void validate(Object value) throws Validator.InvalidValueException
validate
in interface Validator
value
- the value to validate.
Validator.InvalidValueException
- if the value was invalid.public final boolean isNullAllowed()
true
if nulls are allowed otherwise
false
.
public void setNullAllowed(boolean onlyNullAllowed)
onlyNullAllowed
- If true, only nulls are allowed. If false only non-nulls are
allowed. Do we allow nulls?public String getErrorMessage()
public void setErrorMessage(String errorMessage)
errorMessage
- the Error Message to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |