Example usage for org.springframework.validation Errors setNestedPath

List of usage examples for org.springframework.validation Errors setNestedPath

Introduction

In this page you can find the example usage for org.springframework.validation Errors setNestedPath.

Prototype

void setNestedPath(String nestedPath);

Source Link

Document

Allow context to be changed so that standard validators can validate subtrees.

Usage

From source file:org.sakaiproject.metaobj.utils.mvc.impl.ValidatorBase.java

protected void popNestedPath(Errors errors) {
    String newPath = (String) nestedPathStack.pop();
    errors.setNestedPath(newPath);
}

From source file:org.sakaiproject.metaobj.utils.mvc.impl.ValidatorBase.java

protected void pushNestedPath(String newPath, Errors errors) {
    String currentPath = errors.getNestedPath();

    nestedPathStack.push(currentPath);//from w  w w  .j  a  v a2 s  . c  om

    errors.setNestedPath(currentPath + newPath);
}

From source file:org.sloth.validation.ObservationValidator.java

@Override
public void validate(Object t, Errors e) {
    rejectIfEmptyOrWhitespace(e, "title", EMPTY_TITLE);
    rejectIfEmptyOrWhitespace(e, "description", EMPTY_DESCRIPTION);
    rejectIfTooLong(e, "title", TOO_LONG_TITLE, 255);
    rejectIfTooLong(e, "description", TOO_LONG_DESCRIPTION, 1000);
    rejectIfNull(e, "categorie", EMPTY_CATEGORIE);
    rejectIfNull(e, "user", EMPTY_USER);
    e.setNestedPath("coordinate");
    invokeValidator(this.coordinateValidator, ((Observation) t).getCoordinate(), e);
    e.setNestedPath(null);//from  ww w  .j av  a 2 s .  c o m
}