A generic
IValidator implementation. Instances of this
class must only be used once.
factory:ValidatorFactory [read-only]
The ValidatorFactory instance used in this validator.
Implementation
public function get factory():ValidatorFactory
public function GenericValidator(factory:ValidatorFactory)
Constructs a new GenericValidator instance.
Parameters
| factory:ValidatorFactory — the ValidatorFactory to be used for
the validation (may not be null).
|
public function accept(visitable:Visitable):Boolean
Do validation constraint processing on the supplied visitable instance.
This method first ask the current TraversableResolver if
this visitable is reachable.
Parameters
| visitable:Visitable — the visitable instance to validate.
|
Returns
| Boolean — true if the supplied visitable is reachable,
false otherwise.
|
See also
protected function createConstraintViolation(visitable:Visitable, constraint:IConstraint, violation:String):ConstraintViolation
Parameters
Returns
public function validate(bean:Object, groups:Array = null):Array
Validates all constraints on bean.
Parameters
| bean:Object — the bean to validate.
|
| |
| groups:Array (default = null) — an array of groups targeted for validation (default is
null, meaning that the Default group will be used).
|
Returns
| Array — an array of ConstraintValidation, possibly empty
or null.
|
public function validateProperty(bean:Object, propertyName:String, groups:Array = null):Array
Validates all constraints placed on the property of bean
named propertyName.
Parameters
| bean:Object — the bean holding the property to validate.
|
| |
| propertyName:String — the property name to validate.
|
| |
| groups:Array (default = null) — an array of groups targeted for validation (default is
null, meaning that the Default group will be used).
|
Returns
| Array — an array of ConstraintValidation, possibly empty
or null.
|
public function validateValue(type:Type, propertyName:String, value:Array, groups:* = null):Array
Validates all constraints placed on the property named propertyName
of the class type would the property value be value.
Parameters
| type:Type — the bean type holding the property to validate.
|
| |
| propertyName:String — the property name to validate.
|
| |
| value:Array — the property value to validate.
|
| |
| groups:* (default = null) — an array of groups targeted for validation (default is
null, meaning that the Default group will be used).
|
Returns
| Array — an array of ConstraintValidation, possibly empty
or null.
|
public function visit(visitable:Visitable):Boolean
Ask the current TraversableResolver if the visitable is cascadable
and test if it is bean or collection annotated with [Valid].
Parameters
| visitable:Visitable — the visitable instance to be tested for cascading.
|
Returns
| Boolean — true if the supplied visitable should be cascaded,
false otherwise.
|
See also