1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Interface for validatable objects."""
17
18
20 """Interface for validatable objects. Defines methods to verify if the
21 object's value is valid or not, and to add, remove and list registered
22 validators of the object.
23
24 @author: Vaadin Ltd.
25 @author: Richard Lincoln
26 @version: 1.1.2
27 @see: L{IValidator}
28 """
29
31 """Adds a new validator for this object. The validator's
32 L{Validator.validate} method is activated every time the
33 object's value needs to be verified, that is, when the L{isValid}
34 method is called. This usually happens when the object's value changes.
35
36 @param validator:
37 the new validator
38 """
39 raise NotImplementedError
40
41
43 """Removes a previously registered validator from the object. The
44 specified validator is removed from the object and its C{validate}
45 method is no longer called in L{isValid}.
46
47 @param validator:
48 the validator to remove
49 """
50 raise NotImplementedError
51
52
54 """Lists all validators currently registered for the object. If no
55 validators are registered, returns C{None}.
56
57 @return: collection of validators or C{None}
58 """
59 raise NotImplementedError
60
61
63 """Tests the current value of the object against all registered
64 validators. The registered validators are iterated and for each the
65 L{Validator.validate} method is called. If any validator
66 throws the L{InvalidValueException} this method returns
67 C{False}.
68
69 @return: C{True} if the registered validators concur that the
70 value is valid, C{False} otherwise
71 """
72 raise NotImplementedError
73
74
76 """Checks the validity of the validatable. If the validatable is valid
77 this method should do nothing, and if it's not valid, it should throw
78 C{InvalidValueException}
79
80 @raise InvalidValueException:
81 if the value is not valid
82 """
83 raise NotImplementedError
84
85
87 """Checks the validabtable object accept invalid values.The default
88 value is C{True}.
89 """
90 raise NotImplementedError
91
92
94 """Should the validabtable object accept invalid values. Supporting
95 this configuration possibility is optional. By default invalid values
96 are allowed.
97
98 @raise NotImplementedError:
99 if the setInvalidAllowed is not supported.
100 """
101 raise NotImplementedError
102