|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.millstone.base.data.validator.NullValidator
Nested Class Summary |
Nested classes inherited from class org.millstone.base.data.Validator |
Validator.InvalidValueException, Validator.Suggestive |
Constructor Summary | |
NullValidator(java.lang.String errorMessage,
boolean allowNull)
Create a new NullValidator |
Method Summary | |
java.lang.String |
getErrorMessage()
Get the error message that is displayed in case the value is invalid. |
boolean |
isNullAllowed()
True if nulls are allowed. |
boolean |
isValid(java.lang.Object value)
True of the value is valid. |
void |
setErrorMessage(java.lang.String errorMessage)
Set the error message to be displayed on invalid value. |
void |
setNullAllowed(boolean allowNull)
Sets if nulls are to be allowed. |
void |
validate(java.lang.Object value)
Validate 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(java.lang.String errorMessage, boolean allowNull)
errorMessage
- - The error message to display on invalidation.allowNull
- - Are nulls allowed?Method Detail |
public void validate(java.lang.Object value) throws Validator.InvalidValueException
validate
in interface Validator
value
- - The value to validate.
Validator.InvalidValueException
- - The value was invalid.public boolean isValid(java.lang.Object value)
isValid
in interface Validator
value
- - The value to validate.public final boolean isNullAllowed()
public void setNullAllowed(boolean allowNull)
allowNull
- - Do we allow nulls?public java.lang.String getErrorMessage()
public void setErrorMessage(java.lang.String errorMessage)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |