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.

Implementers

Constructors

ConstraintValidator([List argumentValues])

Properties

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

Methods

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

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited