Package muntjac :: Package data :: Package validators :: Module regexp_validator :: Class RegexpValidator
[hide private]
[frames] | no frames]

Class RegexpValidator

source code

                               object --+            
                                        |            
                     validator.IValidator --+        
                                            |        
         abstract_validator.AbstractValidator --+    
                                                |    
abstract_string_validator.AbstractStringValidator --+
                                                    |
                                                   RegexpValidator
Known Subclasses:

String validator comparing the string against a regular expression. Both complete matches and substring matches are supported.

See AbstractStringValidator for more information.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, *args)
Creates a validator for checking that the regular expression matches the string to validate.
source code
 
__getstate__(self) source code
 
__setstate__(self, d) source code
 
isValidString(self, value)
Checks if the given string is valid.
source code

Inherited from abstract_string_validator.AbstractStringValidator: isValid

Inherited from abstract_validator.AbstractValidator: getErrorMessage, setErrorMessage, validate

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 

Creates a validator for checking that the regular expression matches the string to validate.

Parameters:
  • args - tuple of the form
    • (regexp, errorMessage)
      1. a regular expression
      2. the message to display in case the value does not validate.
    • (regexp, complete, errorMessage)
      1. a regular expression
      2. true to use check for a complete match, false to look for a matching substring
      3. the message to display in case the value does not validate.
Overrides: object.__init__

isValidString(self, value)

source code 

Checks if the given string is valid.

Parameters:
  • value - String to check. Can never be None.
Returns:
true if the string is valid, false otherwise
Overrides: abstract_string_validator.AbstractStringValidator.isValidString
(inherited documentation)