Package org.springmodules.validation.bean.conf

Examples of org.springmodules.validation.bean.conf.ValidationConfigurationException


            if (PropertyValidationAnnotationHandler.class.isInstance(handler)) {
                propertyHandlers.add(handler);
            } else if (ClassValidationAnnotationHandler.class.isInstance(handler)) {
                classHandlers.add(handler);
            } else {
                throw new ValidationConfigurationException("class '" + className + "' is not a property hanlder nor a class handler");
            }
        }
        registryBuilder.addPropertyValue(
            "extraPropertyHandlers",
            propertyHandlers.toArray(new PropertyValidationAnnotationHandler[propertyHandlers.size()])
View Full Code Here


        Class clazz;
        try {
            clazz = ClassUtils.forName(className);
            return clazz.newInstance();
        } catch (ClassNotFoundException cnfe) {
            throw new ValidationConfigurationException("Could not load class '" + className + "'", cnfe);
        } catch (IllegalAccessException iae) {
            throw new ValidationConfigurationException("Could not instantiate class '" + className + "'", iae);
        } catch (InstantiationException ie) {
            throw new ValidationConfigurationException("Could not instantiate class '" + className + "'", ie);
        }
    }
View Full Code Here

    }

    protected Resource createResource(Element resourceDefinition) {
        String path = resourceDefinition.getAttribute(LOCATION_ATTR);
        if (!StringUtils.hasText(path)) {
            throw new ValidationConfigurationException("Resoruce path is required and cannot be empty");
        }
        return new DefaultResourceLoader().getResource(path);
    }
View Full Code Here

            if (PropertyValidationElementHandler.class.isInstance(handler)) {
                propertyHandlers.add(handler);
            } else if (ClassValidationElementHandler.class.isInstance(handler)) {
                classHandlers.add(handler);
            } else {
                throw new ValidationConfigurationException("class '" + className + "' is not a property hanlder nor a class handler");
            }
        }
        registryBuilder.addPropertyValue(
            "extraPropertyHandlers",
            propertyHandlers.toArray(new PropertyValidationElementHandler[propertyHandlers.size()])
View Full Code Here

        Class clazz;
        try {
            clazz = ClassUtils.forName(className);
            return clazz.newInstance();
        } catch (ClassNotFoundException cnfe) {
            throw new ValidationConfigurationException("Could not load class '" + className + "'", cnfe);
        } catch (IllegalAccessException iae) {
            throw new ValidationConfigurationException("Could not instantiate class '" + className + "'", iae);
        } catch (InstantiationException ie) {
            throw new ValidationConfigurationException("Could not instantiate class '" + className + "'", ie);
        }
    }
View Full Code Here

    }

    protected AbstractValidationRule createValidationRule(Element element) {
        String expression = element.getAttribute(CONDITION_ATTR);
        if (!StringUtils.hasText(expression)) {
            throw new ValidationConfigurationException("Element '" + ELEMENT_NAME + "' must have a '" + CONDITION_ATTR + "' attribute");
        }
        return new ExpressionValidationRule(getConditionExpressionParser(), expression);
    }
View Full Code Here

            return true;
        }
        if (PROPERTY_SCOPE_VALUE.equals(value)) {
            return false;
        }
        throw new ValidationConfigurationException("Unknown value '" + value + "' for attribute '" + SCOPE_ATTR + "'");
    }
View Full Code Here

    }

    protected AbstractValidationRule createValidationRule(Element element) {
        String expression = element.getAttribute(CONDITION_ATTR);
        if (!StringUtils.hasText(expression)) {
            throw new ValidationConfigurationException("Element '" + ELEMENT_NAME + "' must have a '" + CONDITION_ATTR + "' attribute");
        }
        return new ExpressionValidationRule(getConditionExpressionParser(), expression);
    }
View Full Code Here

    }

    protected AbstractValidationRule createValidationRule(Element element) {
        String expression = element.getAttribute(EXPRESSION_ATTR);
        if (!StringUtils.hasText(expression)) {
            throw new ValidationConfigurationException("Element '" + ELEMENT_NAME + "' must have an 'expression' attribute");
        }
        return new RegExpValidationRule(expression);
    }
View Full Code Here

        if (max != null) {
            return new MaxValidationRule(max);
        }

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

TOP

Related Classes of org.springmodules.validation.bean.conf.ValidationConfigurationException

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.