Package br.com.caelum.vraptor.validator

Examples of br.com.caelum.vraptor.validator.SimpleMessage


      for (ConstraintViolation<Object> v : violations) {
        BeanValidatorContext ctx = new BeanValidatorContext(v);
        String msg = interpolator.interpolate(v.getMessageTemplate(), ctx, locale);
        String category = extractCategory(methodInfo.getValuedParameters(), v);
        validator.add(new SimpleMessage(category, msg));
        logger.debug("added message {}={} for contraint violation", category, msg);
      }
    }
  }
View Full Code Here


      for (ConstraintViolation<Object> v : violations) {
        BeanValidatorContext ctx = new BeanValidatorContext(v);
        String msg = interpolator.interpolate(v.getMessageTemplate(), ctx, locale);
        String category = extractCategory(methodInfo.getValuedParameters(), v);
        validator.add(new SimpleMessage(category, msg));
        logger.debug("added message {}={} for contraint violation", category, msg);
      }
    }
  }
View Full Code Here

      logger.debug("there are {} constraint violations at method {}.", violations.size(), method);

      for (ConstraintViolation<Object> v : violations) {
        String category = extractCategory(methodInfo.getValuedParameters(), v);
        String msg = extractInternacionalizedMessage(v);
        validator.add(new SimpleMessage(category, msg));
        logger.debug("added message {}={} for contraint violation", category, msg);
      }
    }
  }
View Full Code Here

      }
    }
  }

  public void reject(String field, String message) {
    addFieldError(new SimpleMessage(field, message));
  }
View Full Code Here

  public void reject(String field, String message) {
    addFieldError(new SimpleMessage(field, message));
  }

  public void reject(String message) {
    addGlobaldError(new SimpleMessage("", message));
  }
View Full Code Here

    for (ConstraintViolation<Object> v : violations) {
      BeanValidatorContext ctx = new BeanValidatorContext(v);
      String msg = interpolator.interpolate(v.getMessageTemplate(), ctx, locale);
      String category = extractCategory(params, v);
      validator.add(new SimpleMessage(category, msg));
     
      logger.debug("added message {}={} for contraint violation", category, msg);
    }

    stack.next(method, controllerInstance);
View Full Code Here

  }

  @Override
  public <T> Validator addAll(Set<ConstraintViolation<T>> errors) {
    for (ConstraintViolation<T> v : errors) {
      add(new SimpleMessage(v.getPropertyPath().toString(), v.getMessage()));
    }
    return this;
  }
View Full Code Here

      logger.debug("there are {} constraint violations at method {}.", violations.size(), method);

      for (ConstraintViolation<Object> v : violations) {
        String category = extractCategory(methodInfo.getValuedParameters(), v);
        String msg = extractInternacionalizedMessage(v);
        validator.add(new SimpleMessage(category, msg));
        logger.debug("added message {}={} for contraint violation", category, msg);
      }
    }
  }
View Full Code Here

      return null;
    }
  }
  private void handleException(Target<?> target, Throwable e) {
    if (e.getClass().isAnnotationPresent(ValidationException.class)) {
      errors.add(new SimpleMessage(target.getName(), e.getLocalizedMessage()));
    } else if (e.getCause() == null) {
      throw new InvalidParameterException("Exception when trying to instantiate " + target, e);
    } else {
      handleException(target, e.getCause());
    }
View Full Code Here

    for (ConstraintViolation<Object> v : violations) {
      BeanValidatorContext ctx = new BeanValidatorContext(v);
      String msg = interpolator.interpolate(v.getMessageTemplate(), ctx, locale);
      String category = extractCategory(names, v);
      validator.add(new SimpleMessage(category, msg));
     
      logger.debug("added message {}={} for contraint violation", msg, category);
    }

    stack.next(method, controllerInstance);
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.validator.SimpleMessage

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.