NAME
Kernel::System::DataValidation::Validator::DataType – Validator that verifies a value against given data types.
PUBLIC INTERFACE
Provides a Check
method, that will be called by the Kernel::System::DataValidation backend.
Example()
Returns an example of a possible value to be verified.
Check()
Checks the given value against the given data type definitions. For more information about possible data types, please refer to Kernel::System::DataTypes.
The patterns needs to be passed as the Arguments
parameter and may be just strings, representing the data type name, or data type objects.
my $True = $Validator->Check(
Arguments => [ 'Str', t('StrWithData') ],
Value => 'MyValue',
);
my $False = $Validator->Check(
Arguments => ['HashRefWithData'],
Value => 'MyValue',
);
my $True = $Validator->Check(
Arguments => { Strict => 0, Type => 'PositiveInt', },
Value => '',
);