Runtime components : Core components : Typed data : Concepts : Validators
  
Validators
A validator ensures that the data in a typed data element conforms to the business rules of the data element's business object. The property descriptor definition for the type specifies the validator. If the property descriptor does not specify a validator, all values for the data element are valid.
To validate data for a type, a validator requires a String or an object of that type. If the passed object is a String, the validator must first convert the String to the type before it can perform the validation. Unless there is a converter identified in a passed conversionType parameter, the validator uses the default converter of owning property descriptor to perform the conversion. For this reason, the property descriptor must have at least one converter of the default category defined. Some types contain data that changes according to the locale. If this is the case, the validator can perform the validation using a specific locale. By default, the toolkit uses its default locale.
You can define parameters for a validator using key-value pairs. For example, a validator for a date type checks whether the value to be validated lies within limits defined by parameters such as lowerLimit and upperLimit. The owning property descriptor can also define these key-value pairs. The validator first looks for the parameters in the owning descriptor before checking its own Hashtable.
See
Validation hierarchy
Data element validation
Go up to
Concepts