org.millstone.base.data.validator
Class NullValidator

java.lang.Object
  |
  +--org.millstone.base.data.validator.NullValidator
All Implemented Interfaces:
Validator

public class NullValidator
extends java.lang.Object
implements Validator


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

NullValidator

public NullValidator(java.lang.String errorMessage,
                     boolean allowNull)
Create a new NullValidator

Parameters:
errorMessage - - The error message to display on invalidation.
allowNull - - Are nulls allowed?
Method Detail

validate

public void validate(java.lang.Object value)
              throws Validator.InvalidValueException
Validate the data given in value.

Specified by:
validate in interface Validator
Parameters:
value - - The value to validate.
Throws:
Validator.InvalidValueException - - The value was invalid.

isValid

public boolean isValid(java.lang.Object value)
True of the value is valid.

Specified by:
isValid in interface Validator
Parameters:
value - - The value to validate.

isNullAllowed

public final boolean isNullAllowed()
True if nulls are allowed.


setNullAllowed

public void setNullAllowed(boolean allowNull)
Sets if nulls are to be allowed.

Parameters:
allowNull - - Do we allow nulls?

getErrorMessage

public java.lang.String getErrorMessage()
Get the error message that is displayed in case the value is invalid.


setErrorMessage

public void setErrorMessage(java.lang.String errorMessage)
Set the error message to be displayed on invalid value.



Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.