Package org.libreplan.business.common.exceptions

Examples of org.libreplan.business.common.exceptions.ValidationException$BasedOnConstraintViolation


        if (date == null) {
            if (version.equals(getBaseCalendar().getLastCalendarData())) {
                return;
            } else {
                throw new ValidationException(_("This date cannot be empty"));
            }
        }

        LocalDate newExpiringDate = LocalDate.fromDateFields(date);
        if ((index < getBaseCalendar().getCalendarDataVersions().size() - 1)) {
            LocalDate nextExpiringDate = getBaseCalendar()
                    .getCalendarDataVersions().get(index + 1).getExpiringDate();
            if ((nextExpiringDate == null)
                    || (newExpiringDate.compareTo(nextExpiringDate) < 0)) {
                return;
            }
        }
        throw new ValidationException(
                _("Date cannot include the entire next work week"));
    }
View Full Code Here


    @Override
    public void checkInvalidValuesCalendar(BaseCalendar entity)
            throws ValidationException {
        if (baseCalendarDAO.thereIsOtherWithSameName(entity)) {
            throw new ValidationException(_("Could not save the new calendar"),
                    invalidValue(_("{0} already exists", entity.getName()),
                            "name", entity.getName(), entity));
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void validate() throws ValidationException {
        Set<ConstraintViolation<BaseEntity>> violations = validator
                .validate(this);
        if (!violations.isEmpty()) {
            throw new ValidationException(violations);
        }
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.common.exceptions.ValidationException$BasedOnConstraintViolation

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.