Examples of ValidationError


Examples of org.xwiki.validator.ValidationError

        // NOTE this method produces false NEGATIVES if JavaScript escaping is used where XML/URL escaping is needed
        int idx = 0;
        while ((idx = line.indexOf(testMatch, idx)) >= 0) {
            // avoid false positives caused by JavaScript escaping
            if (!isJavascriptEscaped(line, testMatch, idx)) {
                this.errors.add(new ValidationError(Type.ERROR, lineNr, idx, errorMessage));
            }
            idx++;
        }
    }
View Full Code Here

Examples of org.xwiki.validator.ValidationError

        int idx = 0;
        while ((idx = line.indexOf(TEST_APOS, idx)) >= 0) {
            // ignore if quote was not escaped either
            int expected_idx = idx - offset;
            if (expected_idx < 0 || line.indexOf(TEST_QUOT, expected_idx) != expected_idx) {
                this.errors.add(new ValidationError(Type.WARNING, lineNr, idx, "Unescaped ' character"));
            }
            idx++;
        }
        idx = 0;
        while ((idx = line.indexOf(TEST_QUOT, idx)) >= 0) {
            // ignore if apostrophe was not escaped either
            int expected_idx = idx + offset;
            if (expected_idx < 0 || line.indexOf(TEST_APOS, expected_idx) != expected_idx) {
                this.errors.add(new ValidationError(Type.WARNING, lineNr, idx, "Unescaped \" character"));
            }
            idx++;
        }
    }
View Full Code Here

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
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.