text_lint.operations.mixins.parameter_validation.ParameterValidationMixin

class text_lint.operations.mixins.parameter_validation.ParameterValidationMixin[Quellcode]

Bases: object

A mixin class to validate constructor parameters.

__parse_parameter_definition__(attribute_name: str) ParameterDefinition[Quellcode]

Generate a ParameterDefinition instance from the given attribute name.

Parameter:

attribute_name (str) – The name of the attribute that will be parsed.

Rückgabe:

The generated ParameterDefinition instance.

Raises:

InvalidParameterValidation

Rückgabetyp:

ParameterDefinition

__raise_type_error__(definition: ParameterDefinition) None[Quellcode]

Raise a TypeError derived from the given ParameterDefinition.

Parameter:

definition (ParameterDefinition) – The ParameterDefinition instance that will be used.

Raises:

TypeError

__validate_attribute__(definition: ParameterDefinition) None[Quellcode]

Validate the mixed-in class with a ParameterDefinition.

Parameter:

definition (ParameterDefinition) – The ParameterDefinition instance that will be used.

Rückgabe:

The generated ParameterDefinition instance.

Raises:

TypeError

Rückgabetyp:

None

__validate_container_attribute__(definition: ParameterDefinition) None[Quellcode]

Validate a container-type attribute value with a ParameterDefinition.

Parameter:

definition (ParameterDefinition) – The ParameterDefinition instance that will be used.

Raises:

TypeError

__validate_dict_attribute__(definition: ParameterDefinition) None[Quellcode]

Validate a dictionary attribute value with a ParameterDefinition.

Parameter:

definition (ParameterDefinition) – The ParameterDefinition instance that will be used.

Raises:

TypeError

__validate_iterable_attribute__(definition: ParameterDefinition) None[Quellcode]

Validate an iterable attribute value with a ParameterDefinition.

Parameter:

definition (ParameterDefinition) – The ParameterDefinition instance that will be used.

Raises:

TypeError

__validate_numeric_attribute__(definition: ParameterDefinition) None[Quellcode]

Validate a numeric attribute value with a ParameterDefinition.

Parameter:

definition (ParameterDefinition) – The ParameterDefinition instance that will be used.

Raises:

TypeError

validate_parameters() None[Quellcode]

Validate the parameters used to instantiate a mixed-in class.

Raises:

InvalidParameterValidation, TypeError