Examples of MaxLengthValidationRule


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

        // handling max length only if other explicit validation annotations do not exist and if the property is a string.
        if (String.class == descriptor.getPropertyType() &&
            (!LibraryUtils.HIBERNATE_VALIDATOR_IN_CLASSPATH || !contains(annotations, org.hibernate.validator.Length.class))) {
            int length = column.length();
            PropertyValidationRule propertyRule = new PropertyValidationRule(descriptor.getName(), new MaxLengthValidationRule(length));
            configuration.addPropertyRule(descriptor.getName(), propertyRule);
        }

        // handling nullability only if other explicit validation annotations do not exist.
        if (!contains(annotations, NotNull.class) &&
View Full Code Here

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

        if (min != null) {
            return new MinLengthValidationRule(min.intValue());
        }

        if (max != null) {
            return new MaxLengthValidationRule(max.intValue());
        }

        throw new ValidationConfigurationException("Element '" + ELEMENT_NAME +
            "' must have either 'min' attribute, 'max' attribute, or both");
    }
View Full Code Here

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

        }

        if (MaxLength.class.isInstance(annotation)) {
            MaxLength maxLength = (MaxLength) annotation;
            validateMax(maxLength.value(), clazz, propertyName);
            return new MaxLengthValidationRule(maxLength.value());
        }

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

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

        if (min != null) {
            return new MinLengthValidationRule(min.intValue());
        }

        if (max != null) {
            return new MaxLengthValidationRule(max.intValue());
        }

        throw new ValidationConfigurationException("Element '" + ELEMENT_NAME +
            "' must have either 'min' attribute, 'max' attribute, or both");
    }
View Full Code Here

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

        if (min != null) {
            return new MinLengthValidationRule(min.intValue());
        }

        if (max != null) {
            return new MaxLengthValidationRule(max.intValue());
        }

        throw new ValidationConfigurationException("Element '" + ELEMENT_NAME +
            "' must have either 'min' attribute, 'max' attribute, or both");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.