Groovy Documentation

org.codehaus.groovy.grails.validation
[Java] Class DefaultConstraintEvaluator

java.lang.Object
  org.codehaus.groovy.grails.validation.DefaultConstraintEvaluator
All Implemented Interfaces:
ConstraintsEvaluator

public class DefaultConstraintEvaluator
extends java.lang.Object

Default implementation of the ConstraintsEvaluator interface. TODO: Subclass this to add hibernate-specific exceptions!

Authors:
Graeme Rocher
Since:
2.0


Constructor Summary
DefaultConstraintEvaluator(java.util.Map defaultConstraints)

DefaultConstraintEvaluator()

 
Method Summary
protected void applyDefaultConstraints(java.lang.String propertyName, GrailsDomainClassProperty p, ConstrainedProperty cp, java.util.Map defaultConstraints)

protected void applyDefaultNullableConstraint(GrailsDomainClassProperty p, ConstrainedProperty cp)

protected void applyDefaultNullableConstraint(ConstrainedProperty cp)

protected void applyMapOfConstraints(java.util.Map constraints, java.lang.String propertyName, GrailsDomainClassProperty p, ConstrainedProperty cp)

protected void applySharedConstraints(ConstrainedPropertyBuilder constrainedPropertyBuilder, java.util.Map constrainedProperties)

protected boolean canApplyNullableConstraint(java.lang.String propertyName, GrailsDomainClassProperty property, ConstrainedProperty constrainedProperty)

protected boolean canPropertyBeConstrained(GrailsDomainClassProperty property)

java.util.Map evaluate(java.lang.Class cls)

java.util.Map evaluate(GrailsDomainClass cls)

java.util.Map evaluate(java.lang.Object object, GrailsDomainClassProperty[] properties)

java.util.Map evaluate(java.lang.Class cls, GrailsDomainClassProperty[] properties)

protected java.util.Map evaluateConstraints(java.lang.Class theClass, GrailsDomainClassProperty[] properties)

Evaluates the constraints closure to build the list of constraints

protected groovy.lang.Closure getConstraintsFromScript(java.lang.Class theClass)

java.util.Map getDefaultConstraints()

static java.util.LinkedList getSuperClassChain(java.lang.Class theClass)

protected boolean isConstrainableProperty(GrailsDomainClassProperty p, java.lang.String propertyName)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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()
 

Constructor Detail

DefaultConstraintEvaluator

public DefaultConstraintEvaluator(java.util.Map defaultConstraints)


DefaultConstraintEvaluator

public DefaultConstraintEvaluator()


 
Method Detail

applyDefaultConstraints

if (o instanceof Map) {
protected void applyDefaultConstraints(java.lang.String propertyName, GrailsDomainClassProperty p, ConstrainedProperty cp, aints(globalConstraints, pro java.util.Map defaultConstraints)


applyDefaultNullableConstraint

protected void applyDefaultNullableConstraint(LABLE_CONSTRAINT, isCollecti GrailsDomainClassProperty p, ConstrainedProperty cp)


applyDefaultNullableConstraint

protected void applyDefaultNullableConstraint(ConstrainedProperty cp)


applyMapOfConstraints

protected void applyMapOfConstraints(java.util.Map constraints, java.lang.String propertyName, GrailsDomainClassProperty p, ConstrainedProperty cp)


applySharedConstraints

protected void applySharedConstraints(ConstrainedPropertyBuilder constrainedPropertyBuilder, java.util.Map constrainedProperties)


canApplyNullableConstraint

protected boolean canApplyNullableConstraint(java.lang.String propertyName, GrailsDomainClassProperty property, ConstrainedProperty constrainedProperty)


canPropertyBeConstrained

protected boolean canPropertyBeConstrained( GrailsDomainClassProperty property)


evaluate

public java.util.Map evaluate( java.lang.Class cls)


evaluate

public java.util.Map evaluate(GrailsDomainClass cls)


evaluate

public java.util.Map evaluate(java.lang.Object object, GrailsDomainClassProperty[] properties)


evaluate

public java.util.Map evaluate(java.lang.Class cls, GrailsDomainClassProperty[] properties)


evaluateConstraints

protected java.util.Map evaluateConstraints(java.lang.Class theClass, GrailsDomainClassProperty[] properties)
Evaluates the constraints closure to build the list of constraints
Parameters:
theClass - The domain class to evaluate constraints for
properties - The properties of the instance
Returns:
A Map of constraints


getConstraintsFromScript

protected groovy.lang.Closure getConstraintsFromScript(java.lang.Class theClass)


getDefaultConstraints

public java.util.Map getDefaultConstraints()


getSuperClassChain

public static java.util.LinkedList getSuperClassChain(java.lang.Class theClass)


isConstrainableProperty

protected boolean isConstrainableProperty(GrailsDomainClassProperty p, java.lang.String propertyName)


 

Groovy Documentation