class Athena::Validator::Validator::RecursiveContextualValidator
inherits Reference
#
A recursive implementation of AVD::Validator::ContextualValidatorInterface
.
See Athena::Validator.validator
.
Included modules
Athena::Validator::Validator::ContextualValidatorInterface
Class methods#
.new(context : AVD::ExecutionContextInterface, constraint_validator_factory : AVD::ConstraintValidatorFactoryInterface, metadata_factory : AVD::Metadata::MetadataFactoryInterface)
#
(context : AVD::ExecutionContextInterface, constraint_validator_factory : AVD::ConstraintValidatorFactoryInterface, metadata_factory : AVD::Metadata::MetadataFactoryInterface)
Methods#
#at_path(path : String) : AVD::Validator::ContextualValidatorInterface
#
(path : String) : AVD::Validator::ContextualValidatorInterface
Appends the provided path to the current AVD::ExecutionContextInterface#property_path
.
#validate(value : _, constraints : Array(AVD::Constraint) | AVD::Constraint | Nil = nil, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Validator::ContextualValidatorInterface
#
(value : _, constraints : Array(AVD::Constraint) | AVD::Constraint | Nil = nil, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Validator::ContextualValidatorInterface
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.
#validate_property(object : AVD::Validatable, property_name : String, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Validator::ContextualValidatorInterface
#
(object : AVD::Validatable, property_name : String, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Validator::ContextualValidatorInterface
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.
#validate_property_value(object : AVD::Validatable, property_name : String, value : _, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Validator::ContextualValidatorInterface
#
(object : AVD::Validatable, property_name : String, value : _, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Validator::ContextualValidatorInterface
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.
#violations : AVD::Violation::ConstraintViolationListInterface
#
: AVD::Violation::ConstraintViolationListInterface
Returns any violations that have been generated so far in the context of self
.