Package org.springmodules.validation.bean.rule

Examples of org.springmodules.validation.bean.rule.PropertyValidationRule


                }
                return Character.isUpperCase(text.charAt(0));
            }
        };
        DefaultValidationRule rule = new DefaultValidationRule(cond, "is.first.letter.capitalized");
        configuration.addPropertyRule(propertyName, new PropertyValidationRule(propertyName, rule));
    }
View Full Code Here


            handler.handle(ruleDefinition, propertyName, configuration);
        }
    }

    protected PropertyValidationRule createPropertyRule(String propertyName, ValidationRule rule) {
        return new PropertyValidationRule(propertyName, rule);
    }
View Full Code Here

     * @param propertyRule
     *            The rule that should be applied on the value of the given property.
     * @see #addPropertyRule(String, org.springmodules.validation.util.condition.Condition, String)
     */
    public void addPropertyRule(String propertyName, ValidationRule propertyRule) {
        addPropertyGlobalRule(propertyName, new PropertyValidationRule(propertyName, propertyRule));
    }
View Full Code Here

                return Character.isUpperCase(text.charAt(0));
            }
        };
        String propertyName = descriptor.getName();
        DefaultValidationRule rule = new DefaultValidationRule(cond, "is.first.letter.capitalized");
        configuration.addPropertyRule(propertyName, new PropertyValidationRule(propertyName, rule));
    }
View Full Code Here

        }

        if (isConditionGloballyScoped(annotation)) {
            configuration.addPropertyRule(descriptor.getName(), rule);
        } else {
            PropertyValidationRule propertyRule = new PropertyValidationRule(descriptor.getName(), rule);

            // By definition, the applicability condition should be evaluated on the validated bean and not on the
            // validated bean property. Thus we need to explicitely set the applicability condition on the validation
            // rule otherwise the default applicability condition to be evaluated on the property value.
            if (applicabilityCondition != null) {
                propertyRule.setApplicabilityCondition(applicabilityCondition);
            }

            configuration.addPropertyRule(descriptor.getName(), propertyRule);
        }
    }
View Full Code Here

        configuration.addCascadeValidation(new CascadeValidation("name"));
        registryControl.expectAndReturn(registry.findPropertyHandler(ruleDefinition, TestBean.class, descriptor), propertyHandler);
        propertyHandler.handle(ruleDefinition, "name", configuration);

        final PropertyValidationRule propertyRule = new PropertyValidationRule("name", rule);
        loader = new DefaultXmlBeanValidationConfigurationLoader(registry) {
            protected PropertyValidationRule createPropertyRule(String propertyName, ValidationRule rule) {
                return propertyRule;
            }
        };
View Full Code Here

        }

        if (isConditionGloballyScoped(element)) {
            configuration.addPropertyRule(propertyName, rule);
        } else {
            configuration.addPropertyRule(propertyName, new PropertyValidationRule(propertyName, rule));
        }

    }
View Full Code Here

        }

        if (isConditionGloballyScoped(annotation)) {
            configuration.addPropertyRule(descriptor.getName(), rule);
        } else {
            configuration.addPropertyRule(descriptor.getName(), new PropertyValidationRule(descriptor.getName(), rule));
        }
    }
View Full Code Here

        }

        if (isConditionGloballyScoped(element)) {
            configuration.addPropertyRule(propertyName, rule);
        } else {
            PropertyValidationRule propertyRule = new PropertyValidationRule(propertyName, rule);

            // By definition, the applicability condition should be evaluated on the validated bean and not on the
            // validated bean property. Thus we need to explicitely set the applicability condition on the validation
            // rule otherwise the default applicability condition to be evaluated on the property value.
            if (applicabilityCondition != null) {
                propertyRule.setApplicabilityCondition(applicabilityCondition);
            }

            if (applicableContexts != null) {
                propertyRule.setContextTokens(applicableContexts);
            }

            configuration.addPropertyRule(propertyName, propertyRule);
        }
View Full Code Here

            handler.handle(ruleDefinition, propertyName, configuration);
        }
    }

    protected PropertyValidationRule createPropertyRule(String propertyName, ValidationRule rule) {
        return new PropertyValidationRule(propertyName, rule);
    }
View Full Code Here

TOP

Related Classes of org.springmodules.validation.bean.rule.PropertyValidationRule

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.