Unit Command.Validator

Uses
Functions and Procedures
Types
Constants
Variables

Description

This unit contains classes to perform the validation of the parameters informed by the user against those defined in the CommandBuilder. To make the code clearer and easier to maintain, the validator pattern was used.

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TValidatorContext Class that groups all validators, as well as establishes the validation order.
Class TValidatorBase 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.
Class TConfiguredCommandWithCallback Returns an error if a command was configured without a callback
Class TDuplicateArgumentValidator Returns an error if a command has been passed twice. A duplicity is accepted if a command accepts another command as an argument through the ccNoArgumentsButCommands constraint.
Class TDuplicateOptionValidator Returns an error if an option was passed twice.
Class TProvidedArgumentsAreNotValid Returns an error if there are commands configured for the CommandBuilder and arguments were passed via the command line, but no command was found.
Class TProvidedArgumentsAreNotRequired Returns an error if not required arguments were passed to the command and the constraint ccNoArgumentsButCommands is active for the command.
Class TProvidedArgumentsExceedsAcceptedLimit Returns an error if more arguments were passed than what was set for the command.
Class TSelectedCommandDoesNotAcceptCommandAsArgument Returns an error if a command was passed to a command that does ot accept this type of parameter. Only works if ccNoArgumentsButCommands constraint is set for the command.
Class TSelectedCommandRequiresValidCommandOrNothing Returns an error if an invalid command was passed to a command that only accepts command as an argument. Only works if ccNoArgumentsButCommands is set for the command.
Class TSelectedCommandRequiresOneArguments Returns an error if no argument has been passed to a command that requires parameters. Only works if ccRequiresOneArgument is set for the command.
Class TSelectedCommandRequiresNoArguments Returns an error if an argument has been passed to a command that does not require parameters. Only works if ccNoParameters is set for the command.
Class TSelectedCommandRequiresOneOption Returns an error if an argument has been passed to a command with out at least one option. Only works if ccRequiresOneOption is not set for the command.
Class TSelectedCommandValidateIfOptionsExists Returns an error if a non-existent option was passed to a command.
Class TSelectedCommandValidateRejectedOption Returns an error if an option has been passed that cannot be used together with another option for a given command.
Class TSelectedCommandValidateOptionValueNotRequired Returns an error if an option has been passed with a value and it is configured to not accept a value.
Class TSelectedCommandValidateOptionValueRequired Returns an error if an option has been passed without a value and it is configured to require a value.

Generated by PasDoc 0.16.0.