use of org.summerb.approaches.validation.ValidationContext in project summerb by skarpushin.
the class UserServiceImpl method validateUser.
private void validateUser(User user) throws FieldValidationException {
ValidationContext ctx = new ValidationContext();
validateEmail(user.getEmail(), ctx);
ctx.validateDataLengthLessOrEqual(user.getDisplayName(), User.FN_DISPLAY_NAME_SIZE, User.FN_DISPLAY_NAME);
if (ctx.getHasErrors()) {
throw new FieldValidationException(ctx.getErrors());
}
}
use of org.summerb.approaches.validation.ValidationContext in project summerb by skarpushin.
the class UserServiceImpl method validateEmail.
private void validateEmail(String email) throws FieldValidationException {
ValidationContext ctx = new ValidationContext();
validateEmail(email, ctx);
if (ctx.getHasErrors()) {
throw new FieldValidationException(ctx.getErrors());
}
}
Aggregations