Packageorg.granite.validation
Interfacepublic interface IValidator
ImplementorsGenericValidator

Validate bean instances or properties.



Public Methods
 MethodDefined by
  
validate(bean:Object, groups:Array = null):Array
Validates all constraints on bean.
IValidator
  
validateProperty(bean:Object, propertyName:String, groups:Array = null):Array
Validates all constraints placed on the property of bean named propertyName.
IValidator
  
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.
IValidator
Method detail
validate()method
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.
validateProperty()method 
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.
validateValue()method 
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.