Package muntjac :: Package data :: Module validator :: Class IValidator
[hide private]
[frames] | no frames]

Class IValidator

source code

object --+
         |
        IValidator
Known Subclasses:

Interface that implements a method for validating if an object is valid or not.

Implementors of this class can be added to any IValidatable implementor to verify its value.

isValid and validate can be used to check if a value is valid. isValid and validate must use the same validation logic so that iff isValid returns false, validate throws an InvalidValueException.

Validators must not have any side effects.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
validate(self, value)
Checks the given value against this validator.
source code
 
isValid(self, value)
Tests if the given value is valid.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

validate(self, value)

source code 

Checks the given value against this validator. If the value is valid the method does nothing. If the value is invalid, an InvalidValueException is thrown.

Parameters:
  • value - the value to check
Raises:

isValid(self, value)

source code 

Tests if the given value is valid. This method must be symmetric with validate so that validate throws an error iff this method returns false.

Parameters:
  • value - the value to check
Returns:
True if the value is valid, False otherwise.