@groovy.transform.CompileStatic class PersistentEntityValidator extends java.lang.Object
A Validator that validates a PersistentEntity against known constraints
Modifiers | Name | Description |
---|---|---|
protected ProxyHandler |
proxyHandler |
Type | Name and description |
---|---|
java.util.Map<java.lang.String, ConstrainedProperty> |
constrainedProperties |
PersistentEntity |
entity |
EntityReflector |
entityReflector |
org.springframework.context.MessageSource |
messageSource |
java.lang.Class |
targetClass |
BeforeValidateHelper |
validateHelper |
Constructor and description |
---|
PersistentEntityValidator
(PersistentEntity entity, org.springframework.context.MessageSource messageSource, ConstraintsEvaluator constraintsEvaluator) |
Type Params | Return Type | Name and description |
---|---|---|
|
protected void |
cascadeToAssociativeProperty(java.lang.Object parent, org.springframework.validation.Errors errors, EntityReflector reflector, Association association, java.util.Set validatedObjects) Cascades validation onto an associative property maybe a one-to-many, one-to-one or many-to-one relationship. |
|
protected void |
cascadeValidationToMany(java.lang.Object parentObject, java.lang.String propertyName, Association association, org.springframework.validation.Errors errors, EntityReflector entityReflector, java.util.Set validatedObjects) Cascades validation to a one-to-many type relationship. |
|
protected void |
cascadeValidationToOne(java.lang.Object parentObject, java.lang.String propertyName, Association association, org.springframework.validation.Errors errors, EntityReflector reflector, java.lang.Object associatedObject, java.lang.Object indexOrKey, java.util.Set validatedObjects) Cascades validation to a one-to-one or many-to-one property. |
|
protected org.springframework.validation.Errors |
retrieveErrors(java.lang.Object associatedObject) |
|
boolean |
supports(java.lang.Class<?> clazz) |
|
void |
validate(java.lang.Object obj, org.springframework.validation.Errors errors, boolean cascade = true) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
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 property