Package br.gov.frameworkdemoiselle

Examples of br.gov.frameworkdemoiselle.UnprocessableEntityException.addViolation()


    UnprocessableEntityException failed = new UnprocessableEntityException();
    int status = new UnprocessableEntityException().getStatusCode();

    for (Iterator<ConstraintViolation<?>> iter = exception.getConstraintViolations().iterator(); iter.hasNext();) {
      ConstraintViolation<?> violation = iter.next();
      failed.addViolation(violation.getPropertyPath().toString(), violation.getMessage());
    }

    getLogger().debug(getBundle().getString("mapping-violations", status, failed.getViolations().toString()));
    return Response.status(status).entity(failed.getViolations()).build();
  }
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.