Package grails.validation

Examples of grails.validation.ConstraintsEvaluator


        return Collections.unmodifiableMap(constraints);
    }

    private void initializeConstraints() {
        // process the constraints
        final ConstraintsEvaluator constraintsEvaluator = getConstraintsEvaluator();
        if(constraintsEvaluator != null) {
            constraints = constraintsEvaluator.evaluate(getClazz(), persistentProperties);
        }
        else {
            constraints = Collections.emptyMap();
        }
    }
View Full Code Here


    public Set getSubClasses() {
        return subClasses;
    }

    public void refreshConstraints() {
        final ConstraintsEvaluator constraintEvaluator = getConstraintsEvaluator();
        if (defaultConstraints!=null) {

            constraints = constraintEvaluator.evaluate(getClazz(), persistentProperties);
        }
        else {
            constraints = constraintEvaluator.evaluate(getClazz(), persistentProperties);
        }

        // Embedded components have their own ComponentDomainClass instance which
        // won't be refreshed by the application. So, we have to do it here.
        for (GrailsDomainClassProperty property : persistentProperties) {
View Full Code Here

        final Class<?> theClass = instance.getClass();
        return getConstraintMap(properties, defaultConstraints, theClass);
    }

    private static Map<String, Constrained> getConstraintMap(GrailsDomainClassProperty[] properties, Map<String, Object> defaultConstraints, Class<?> theClass) {
        ConstraintsEvaluator constraintsEvaluator = GrailsFactoriesLoader.loadFactory(ConstraintsEvaluator.class, defaultConstraints);
        if(constraintsEvaluator != null) {
            return constraintsEvaluator.evaluate(theClass, properties);
        }
        return Collections.emptyMap();
    }
View Full Code Here

            List tmp = getPropertyValue(GrailsDomainClassProperty.TRANSIENT, List.class);
            if (tmp != null) transients = tmp;
            properties = createDomainClassProperties(descriptors);

            ConstraintsEvaluator constraintsEvaluator = getConstraintsEvaluator();
            if(constraintsEvaluator != null) {
                constraints = constraintsEvaluator.evaluate(type, properties);
            }
            else {
                constraints = Collections.emptyMap();
            }
        }
View Full Code Here

TOP

Related Classes of grails.validation.ConstraintsEvaluator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.