DefaultConstraintEvaluator (Grails 3.1.1)
Date: 2016-02-04

Package: org.grails.validation

## [Java] Class DefaultConstraintEvaluator

- org.grails.validation.DefaultConstraintEvaluator

- All Implemented Interfaces and Traits:
    ConstraintsEvaluator, 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

    Constructors
    Constructor and description
    `DefaultConstraintEvaluator (java.util.Map<java.lang.String, java.lang.Object> defaultConstraints)`
    `DefaultConstraintEvaluator ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected void` | `applyDefaultConstraints(java.lang.String propertyName, GrailsDomainClassProperty p, Constrained cp, java.util.Map<java.lang.String, java.lang.Object> defaultConstraints)`
    `protected void` | `applyDefaultNullableConstraint(GrailsDomainClassProperty p, Constrained cp)`
    `protected void` | `applyDefaultNullableConstraint(Constrained cp, boolean defaultNullable)`
    `protected void` | `applyMapOfConstraints(java.util.Map<java.lang.String, java.lang.Object> constraints, java.lang.String propertyName, GrailsDomainClassProperty p, Constrained cp)`
    `protected void` | `applySharedConstraints(ConstrainedPropertyBuilder constrainedPropertyBuilder, java.util.Map<java.lang.String, Constrained> constrainedProperties)`
    `protected boolean` | `canApplyNullableConstraint(java.lang.String propertyName, GrailsDomainClassProperty property, Constrained constrained)`
    `protected boolean` | `canPropertyBeConstrained(GrailsDomainClassProperty property)`
    `java.util.Map<java.lang.String, Constrained>` | `evaluate(java.lang.Class cls)`
    `java.util.Map<java.lang.String, Constrained>` | `evaluate(java.lang.Class cls, boolean defaultNullable)`
    `java.util.Map<java.lang.String, Constrained>` | `evaluate(GrailsDomainClass cls)`
    `java.util.Map<java.lang.String, Constrained>` | `evaluate(java.lang.Object object, GrailsDomainClassProperty[] properties)`
    `java.util.Map<java.lang.String, Constrained>` | `evaluate(java.lang.Class<?> cls, GrailsDomainClassProperty[] properties)`
    `protected java.util.Map<java.lang.String, Constrained>` | `evaluateConstraints(java.lang.Class<?> theClass, GrailsDomainClassProperty[] properties)` Evaluates the constraints closure to build the list of constraints
    `protected java.util.Map<java.lang.String, Constrained>` | `evaluateConstraints(java.lang.Class<?> theClass, GrailsDomainClassProperty[] properties, boolean defaultNullable)` Evaluates the constraints closure to build the list of constraints
    `protected groovy.lang.Closure<?>` | `getConstraintsFromScript(java.lang.Class<?> theClass)`
    `java.util.Map<java.lang.String, java.lang.Object>` | `getDefaultConstraints()`
    `static java.util.LinkedList<?>` | `getSuperClassChain(java.lang.Class<?> theClass)`
    `protected boolean` | `isConstrainableProperty(GrailsDomainClassProperty p, java.lang.String propertyName)`

  - ### Inherited Methods Summary

    Inherited Methods
    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()`

- - ### Constructor Detail

    - #### public DefaultConstraintEvaluator(java.util.Map<java.lang.String, java.lang.Object> defaultConstraints)

    - #### public DefaultConstraintEvaluator()

  - ### Method Detail

    - #### @java.lang.SuppressWarnings("unchecked") protected void applyDefaultConstraints(java.lang.String propertyName, GrailsDomainClassProperty p, Constrained cp, java.util.Map<java.lang.String, java.lang.Object> defaultConstraints)

    - #### protected void applyDefaultNullableConstraint(GrailsDomainClassProperty p, Constrained cp)

    - #### protected void applyDefaultNullableConstraint(Constrained cp, boolean defaultNullable)

    - #### protected void applyMapOfConstraints(java.util.Map<java.lang.String, java.lang.Object> constraints, java.lang.String propertyName, GrailsDomainClassProperty p, Constrained cp)

    - #### protected void applySharedConstraints(ConstrainedPropertyBuilder constrainedPropertyBuilder, java.util.Map<java.lang.String, Constrained> constrainedProperties)

    - #### protected boolean canApplyNullableConstraint(java.lang.String propertyName, GrailsDomainClassProperty property, Constrained constrained)

    - #### protected boolean canPropertyBeConstrained(GrailsDomainClassProperty property)

    - #### public java.util.Map<java.lang.String, Constrained> evaluate(@java.lang.SuppressWarnings("rawtypes") java.lang.Class cls)

    - #### public java.util.Map<java.lang.String, Constrained> evaluate(@java.lang.SuppressWarnings("rawtypes") java.lang.Class cls, boolean defaultNullable)

    - #### public java.util.Map<java.lang.String, Constrained> evaluate(GrailsDomainClass cls)

    - #### public java.util.Map<java.lang.String, Constrained> evaluate(java.lang.Object object, GrailsDomainClassProperty[] properties)

    - #### public java.util.Map<java.lang.String, Constrained> evaluate(java.lang.Class<?> cls, GrailsDomainClassProperty[] properties)

    - #### protected java.util.Map<java.lang.String, Constrained> 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

    - #### protected java.util.Map<java.lang.String, Constrained> evaluateConstraints(java.lang.Class<?> theClass, GrailsDomainClassProperty[] properties, boolean defaultNullable)

      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
        `defaultNullable` - Indicates if properties are nullable by default
      Returns:
        A Map of constraints

    - #### protected groovy.lang.Closure<?> getConstraintsFromScript(java.lang.Class<?> theClass)

    - #### public java.util.Map<java.lang.String, java.lang.Object> getDefaultConstraints()

    - #### public static java.util.LinkedList<?> getSuperClassChain(java.lang.Class<?> theClass)

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