ConstraintValidator<ValueType> class

All validator classes must either extend this class or the ConstraintValidatorContainer class.

All constraint validators will by default allow null values to be valid.

In case a validator does want to check null values within the isValid method, the extending class can set the allowNull property to false.

A constraint validator must populate argumentValues correctly.

The argumentValues will be used as input to the message function.

The argumentValues can be populated directly by calling the super method.

Or if initialize is overridden from within that method.

initialize is called before each isValid call and can be used to initialize any properties which are not easily initializable from the constructor.



ConstraintValidator([List argumentValues])


allowNull bool
null is allowed by default for every ConstraintValidator. [...]
read / write
argumentValues List
read / write
defaultArgumentValues List
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
message Function
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


initialize() → void
isValid(ValueType value, ValueContext context) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
resetArgumentValues() → void
toString() String
Returns a string representation of this object.
validate(ValueType value, [ValueContext context]) bool


operator ==(Object other) bool
The equality operator. [...]