Class TValidatorBase

Unit

Declaration

type TValidatorBase = class(TInterfacedObject, IValidatorBase)

Description

Base class for any validation that needs to be implemented. Specification validations need to inherit from this class by convention from this library. It already has control for the successor validator as well as its automatic call at the appropriate time.

Hierarchy

Overview

Methods

Public constructor Create;
Public function Validate(ACommand: ICommandBuilder): TArray<string>; virtual;

Properties

Public property Sucessor: IValidatorBase read GetSucessor write SetSucessor;

Description

Methods

Public 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.

Public function Validate(ACommand: ICommandBuilder): TArray<string>; virtual;

Validates a single specific case. It must be implemented by the child class. If the validation is successful and there is a successor, the successor's validation method will be called. A TArry<string> will be returned with errors detected whether they are from the current or successor validation.

Parameters
ACommand
CommandBuilder instance containing the arguments, commands and options configured to be validated against the arguments passed to it.

Properties

Public property Sucessor: IValidatorBase read GetSucessor write SetSucessor;

Allows you to set or access the successor validator.


Generated by PasDoc 0.16.0.