Class TValidatorContext
Unit
Declaration
type TValidatorContext = class(TInterfacedObject, IValidatorContext)
Description
Class that groups all validators, as well as establishes the validation order.
Hierarchy
- TInterfacedObject
- TValidatorContext
Overview
Methods
constructor Create; |
|
function Add(AValidator: IValidatorBase): IValidatorContext; |
|
function HandleValidation(ACommand: ICommandBuilder): TArray<string>; |
|
function Validate(ACommand: ICommandBuilder): TArray<string>; |
Description
Methods
constructor Create; |
|
Default class constructor just to create a basic instance of it. It does not require a call to the desctructor as it is interface-based. |
function Add(AValidator: IValidatorBase): IValidatorContext; |
|
Successive calls to the add method are responsible for creating the validation context. This method adds an IValidatorBase and sets it as the successor if a previous IValidatorBase exists.
Parameters
|
function HandleValidation(ACommand: ICommandBuilder): TArray<string>; |
|
Executes the validation of the first added IValidatorBase, being the responsibility of this object to call its successor IValidatorBase and so on.
Parameters
|
function Validate(ACommand: ICommandBuilder): TArray<string>; |
|
Builds the validation context by adding each class of type IValidatorBase. It then calls the first validator triggering the validator pattern.
Parameters
|
Generated by PasDoc 0.16.0.