Package eu.scape_project.planning.validation

Examples of eu.scape_project.planning.validation.ValidationError


    }

    @Override
    protected boolean restrictionIsValid(String leafName, List<ValidationError> errors) {
        if (getRestriction() == null || "".equals(getRestriction())) {
            errors.add(new ValidationError("Please enter a restriction for the scale of type 'Number range' at leaf '" + leafName + "'", this));
            return false;
        }
        if (this.lowerBound >= this.upperBound) {
            errors.add(new ValidationError("The lower bound specified for leaf \"" + leafName + "\" is greater or equal its upper bound!", this));
            return false;
        }
        return true;
    }
View Full Code Here


            TargetValueObject value = mapping.get(key);
            // Target values are initialised and set to 0.0, so we can assume it
            // is not null:
            if ((value.getValue() < 0.0) || (value.getValue() > 5.0)) {
                result = false;
                errors.add(new ValidationError("Transformation of '" + key + "' to " + value.getValue()
                    + ": For ordinal values only target values between 0.0 and 5.0 are allowed.", this));
            }
        }
        return result;
    }
View Full Code Here

     * @return true if thresholds are in proper order
     */
    public boolean isTransformable(List<ValidationError> errors) {
        boolean toReturn = true;
        if (!checkOrder()) {
            errors.add(new ValidationError("The order of thresholds is not consistent.", this));
            toReturn = false;
        }
        return toReturn;
    }
View Full Code Here

    @Override
    protected boolean restrictionIsValid(String leafName,
            List<ValidationError> errors) {
        if (getRestriction() == null || "".equals(getRestriction())) {
            errors.add(new ValidationError("Please enter a restriction for the scale of type 'Ordinal' at leaf '" + leafName + "'", this));
            return false;
        }

        List<String> values = this.getList();
        if (values.size() < 2) {
            errors.add(new ValidationError("At least 2 possible ordinal values have to be defined for leaf \""+ leafName + "\"", this));
            return false;
        }
        for (int i = 0; i < values.size(); i++) {
            if (values.get(i).length() == 0) {
                errors.add(new ValidationError("The empty String is not a valid value for an Ordinal Scale (used in leaf \""
                                + leafName + "\")", this));
                return false;
            } else if (values.lastIndexOf(values.get(i)) > i) {
                errors.add(new ValidationError("\""
                                + values.get(i)
                                + "\" is specified as a possible Ordinal Value of leaf \""
                                + leafName + "\" more than once!", this));
                return false;
            }
View Full Code Here

    }

    @Override
    protected boolean restrictionIsValid(String leafName, List<ValidationError> errors) {
        if (getRestriction() == null || "".equals(getRestriction())) {
            errors.add(new ValidationError("Please enter a restriction for the scale of type 'Int Range' at leaf '" + leafName + "'", this));
            return false;
        }

        if (this.lowerBound >= this.upperBound) {
            errors.add(new ValidationError("The lower bound specified for leaf \"" + leafName + "\" is greater or equal its upper bound!", this));
            return false;
        }
        return true;
    }
View Full Code Here


    @Override
    protected boolean restrictionIsValid(String leafName, List<ValidationError> errors) {
        if (this.upperBound <= 0.0) {
            errors.add(new ValidationError("The upper bound specified for leaf \"" + leafName + "\" is not greater than zero!", this));
            return false;
        }
        return true;
    }
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.validation.ValidationError

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.