public class GrailsDomainClassValidator extends java.lang.Object
A specialised Spring validator that validates a domain class instance using the constraints defined in the static constraints closure.
Modifiers | Name | Description |
---|---|---|
protected GrailsDomainClass |
domainClass |
|
protected GrailsApplication |
grailsApplication |
|
protected org.springframework.context.MessageSource |
messageSource |
|
protected java.lang.Class<?> |
targetClass |
Type | Name and description |
---|---|
protected void |
cascadeToAssociativeProperty(org.springframework.validation.Errors errors, org.springframework.beans.BeanWrapper bean, GrailsDomainClassProperty persistentProperty) Cascades validation onto an associative property maybe a one-to-many, one-to-one or many-to-one relationship. |
protected void |
cascadeValidationToMany(org.springframework.validation.Errors errors, org.springframework.beans.BeanWrapper bean, GrailsDomainClassProperty persistentProperty, java.lang.String propertyName) Cascades validation to a one-to-many type relationship. |
protected void |
cascadeValidationToOne(org.springframework.validation.Errors errors, org.springframework.beans.BeanWrapper bean, java.lang.Object associatedObject, GrailsDomainClassProperty persistentProperty, java.lang.String propertyName, java.lang.Object indexOrKey) Cascades validation to a one-to-one or many-to-one property. |
protected GrailsDomainClass |
getAssociatedDomainClassFromApplication(java.lang.Object associatedObject) |
GrailsDomainClass |
getDomainClass() |
protected void |
postValidate(java.lang.Object obj, org.springframework.validation.Errors errors) Subclasses can overrite to provide custom handling of the errors object post validation. |
void |
setDomainClass(GrailsDomainClass domainClass) @param domainClass The domainClass to set. |
void |
setGrailsApplication(GrailsApplication grailsApplication) |
void |
setMessageSource(org.springframework.context.MessageSource messageSource) @param messageSource The messageSource to set. |
boolean |
supports(java.lang.Class clazz) |
void |
validate(java.lang.Object obj, org.springframework.validation.Errors errors, boolean cascade) @see org.codehaus.groovy.grails.validation.CascadingValidator#validate(Object, org.springframework.validation.Errors, boolean) |
void |
validate(java.lang.Object obj, org.springframework.validation.Errors errors) @see org.springframework.validation.Validator#validate(Object, org.springframework.validation.Errors) |
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 beanpersistentProperty
- 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 instancebean
- The original BeanWrapperpersistentProperty
- 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 valuepersistentProperty
- The GrailsDomainClassProperty instancepropertyName
- The name of the propertySubclasses can overrite to provide custom handling of the errors object post validation.
obj
- The object to validateerrors
- The Errors object
domainClass
- The domainClass to set.
messageSource
- The messageSource to set.