@groovy.transform.CompileStatic class PersistentEntityValidator extends java.lang.Object implements CascadingValidator, ConstrainedEntity
A Validator that validates a PersistentEntity against known constraints
Modifiers | Name | Description |
---|---|---|
private static java.util.List<java.lang.String> |
EMBEDDED_EXCLUDES |
|
private java.util.Map<java.lang.String, grails.gorm.validation.ConstrainedProperty> |
constrainedProperties |
|
private PersistentEntity |
entity |
|
private EntityReflector |
entityReflector |
|
private org.springframework.context.MessageSource |
messageSource |
|
protected ProxyHandler |
proxyHandler |
|
private java.lang.Class |
targetClass |
|
private BeforeValidateHelper |
validateHelper |
Type | Name and description |
---|---|
java.util.Map<java.lang.String, grails.gorm.validation.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 |
---|---|---|
|
private java.lang.String |
buildNestedPath(java.lang.String nestedPath, java.lang.String componentName, java.lang.Object indexOrKey) |
|
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) |
|
private void |
validatePropertyWithConstraint(java.lang.Object obj, java.lang.String propertyName, EntityReflector reflector, org.springframework.validation.Errors errors, grails.gorm.validation.ConstrainedProperty constrainedProperty, PersistentProperty persistentProperty) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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 propertyGroovy Documentation