Package org.springmodules.validation.bean.rule

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


        Integer min = (StringUtils.hasText(minText)) ? new Integer(minText) : null;
        Integer max = (StringUtils.hasText(maxText)) ? new Integer(maxText) : null;

        if (min != null && max != null) {
            return new LengthValidationRule(min.intValue(), max.intValue());
        }

        if (min != null) {
            return new MinLengthValidationRule(min.intValue());
        }
View Full Code Here


    protected AbstractValidationRule createValidationRule(Annotation annotation, Class clazz, String propertyName) {

        if (Length.class.isInstance(annotation)) {
            Length length = (Length) annotation;
            validateMinMax(length.min(), length.max(), clazz, propertyName);
            return new LengthValidationRule(length.min(), length.max());
        }

        if (MinLength.class.isInstance(annotation)) {
            MinLength minLength = (MinLength) annotation;
            validateMin(minLength.value(), clazz, propertyName);
View Full Code Here

        Integer min = (StringUtils.hasText(minText)) ? new Integer(minText) : null;
        Integer max = (StringUtils.hasText(maxText)) ? new Integer(maxText) : null;

        if (min != null && max != null) {
            return new LengthValidationRule(min.intValue(), max.intValue());
        }

        if (min != null) {
            return new MinLengthValidationRule(min.intValue());
        }
View Full Code Here

    protected AbstractValidationRule createValidationRule(Annotation annotation, Class clazz, String propertyName) {

        if (Length.class.isInstance(annotation)) {
            Length length = (Length)annotation;
            validateMinMax(length.min(), length.max(), clazz, propertyName);
            return new LengthValidationRule(length.min(), length.max());
        }

        if (MinLength.class.isInstance(annotation)) {
            MinLength minLength = (MinLength)annotation;
            validateMin(minLength.value(), clazz, propertyName);
            return new MinLengthValidationRule(minLength.value());
        }

        if (Length.class.isInstance(annotation)) {
            Length length = (Length)annotation;
            validateMinMax(length.min(), length.max(), clazz, propertyName);
            return new LengthValidationRule(length.min(), length.max());
        }

        throw new IllegalArgumentException("LengthValidationAnnotationHandler does not suppport annotations of type: " +
            annotation.getClass().getName());
    }
View Full Code Here

        Integer min = (StringUtils.hasText(minText)) ? new Integer(minText) : null;
        Integer max = (StringUtils.hasText(maxText)) ? new Integer(maxText) : null;

        if (min != null && max != null) {
            return new LengthValidationRule(min.intValue(), max.intValue());
        }

        if (min != null) {
            return new MinLengthValidationRule(min.intValue());
        }
View Full Code Here

TOP

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

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.