class Athena::Validator::Validator::RecursiveValidator

Overview

A recursive implementation of AVD::Validator::ValidatorInterface.

See Athena::Validator.validator.

Included Modules

Defined in:

validator/recursive_validator.cr

Constructors

Instance Method Summary

Instance methods inherited from module Athena::Validator::Validator::ValidatorInterface

in_context(context : AVD::ExecutionContextInterface) : AVD::Validator::ContextualValidatorInterface in_context, start_context : AVD::Validator::ContextualValidatorInterface start_context, validate(value : _, constraints : Array(AVD::Constraint) | AVD::Constraint | Nil = nil, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Violation::ConstraintViolationListInterface validate, validate_property(object : AVD::Validatable, property_name : String, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Violation::ConstraintViolationListInterface validate_property, validate_property_value(object : AVD::Validatable, property_name : String, value : _, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Violation::ConstraintViolationListInterface validate_property_value

Constructor Detail

def self.new(validator_factory : AVD::ConstraintValidatorFactoryInterface? = nil, metadata_factory : AVD::Metadata::MetadataFactoryInterface? = nil) #

[View source]

Instance Method Detail

Returns a validator in the provided context.

Violations generated by the returned validator are added to the provided context.


[View source]
def start_context(root = nil) : AVD::Validator::ContextualValidatorInterface #

Creates a new AVD::ExecutionContextInterface and returns a new validator for that context.

Violations generated by the returned validator can be accessed via AVD::Validator::ContextualValidatorInterface#violations.


[View source]
def validate(value : _, constraints : Array(AVD::Constraint) | AVD::Constraint | Nil = nil, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Violation::ConstraintViolationListInterface #

Validates the provided value, optionally against the provided constraints, optionally using the provided groups. AVD::Constraint::DEFAULT_GROUP is assumed if no groups are provided.


[View source]
def validate_property(object : AVD::Validatable, property_name : String, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Violation::ConstraintViolationListInterface #

Validates a property of the provided object against the constraints defined for that property, optionally using the provided groups. AVD::Constraint::DEFAULT_GROUP is assumed if no groups are provided.


[View source]
def validate_property_value(object : AVD::Validatable, property_name : String, value : _, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Violation::ConstraintViolationListInterface #

Validates a value against the constraints defined on the property of the provided object. AVD::Constraint::DEFAULT_GROUP is assumed if no groups are provided.


[View source]