@CompileStatic class PersistentEntityValidator extends Object implements CascadingValidator, ConstrainedEntity
A Validator that validates a PersistentEntity against known constraints
| Modifiers | Name | Description |
|---|---|---|
protected ProxyHandler |
proxyHandler |
| Type | Name and description |
|---|---|
Map<String, ConstrainedProperty> |
constrainedProperties |
PersistentEntity |
entity |
EntityReflector |
entityReflector |
MessageSource |
messageSource |
Class |
targetClass |
BeforeValidateHelper |
validateHelper |
| Constructor and description |
|---|
PersistentEntityValidator(PersistentEntity entity, MessageSource messageSource, ConstraintsEvaluator constraintsEvaluator) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected void |
cascadeToAssociativeProperty(Object parent, Errors errors, EntityReflector reflector, Association association, Set validatedObjects)Cascades validation onto an associative property maybe a one-to-many, one-to-one or many-to-one relationship. |
|
protected void |
cascadeValidationToMany(Object parentObject, String propertyName, Association association, Errors errors, EntityReflector entityReflector, Set validatedObjects)Cascades validation to a one-to-many type relationship. |
|
protected void |
cascadeValidationToOne(Object parentObject, String propertyName, Association association, Errors errors, EntityReflector reflector, Object associatedObject, Object indexOrKey, Set validatedObjects)Cascades validation to a one-to-one or many-to-one property. |
|
protected Errors |
retrieveErrors(Object associatedObject) |
|
boolean |
supports(Class<?> clazz) |
|
void |
validate(Object obj, Errors errors, boolean cascade) |
Cascades validation onto an associative property maybe a one-to-many, one-to-one or many-to-one relationship.
errors - The Errors instnacebean - The original beanassociation - The associative propertyCascades validation to a one-to-many type relationship. Normally a collection such as a List or Set each element in the association will also be validated.
errors - The Errors instanceentityReflector - The entity reflectorassociation - An association whose isOneToMeny() method returns truepropertyName - The name of the propertyCascades validation to a one-to-one or many-to-one property.
errors - The Errors instancebean - The original BeanWrapperassociatedObject - The associated object's current valueassociation - The GrailsDomainClassProperty instancepropertyName - The name of the propertyGroovy Documentation