Package play.data.validation

Examples of play.data.validation.ValidationError


        if (Project.exists(owner, name)) {
            newProjectForm.reject("name", "project.name.duplicate");
        }

        ValidationError error = newProjectForm.error("name");
        if (error != null) {
            if (PatternValidator.message.equals(error.message())) {
                newProjectForm.errors().remove("name");
                newProjectForm.reject("name", "project.name.alert");
            } else if (RestrictedValidator.message.equals(error.message())) {
                newProjectForm.errors().remove("name");
                newProjectForm.reject("name", "project.name.reserved.alert");
            }
        }
View Full Code Here


                flash(Constants.WARNING, "project.logo.fileSizeAlert");
                updateProjectForm.reject("logoPath", "project.logo.fileSizeAlert");
            }
        }

        ValidationError error = updateProjectForm.error("name");
        if (error != null) {
            if (PatternValidator.message.equals(error.message())) {
                flash(Constants.WARNING, "project.name.alert");
                updateProjectForm.errors().remove("name");
                updateProjectForm.reject("name", "project.name.alert");
            } else if (RestrictedValidator.message.equals(error.message())) {
                flash(Constants.WARNING, "project.name.reserved.alert");
                updateProjectForm.errors().remove("name");
                updateProjectForm.reject("name", "project.name.reserved.alert");
            }
        }
View Full Code Here

        //#list-validate
        public List<ValidationError> validate() {
            List<ValidationError> errors = new ArrayList<ValidationError>();
            if (User.byEmail(email) != null) {
                errors.add(new ValidationError("email", "This e-mail is already registered."));
            }
            return errors.isEmpty() ? null : errors;
        }
View Full Code Here

TOP

Related Classes of play.data.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.