org.jboss.resteasy.api.validation

## Class ResteasyViolationExceptionMapper

- java.lang.Object
- - org.jboss.resteasy.api.validation.ResteasyViolationExceptionMapper

- All Implemented Interfaces:
    ExceptionMapper<javax.validation.ValidationException>

      @Provider
      public class ResteasyViolationExceptionMapper
      extends Object
      implements ExceptionMapper<javax.validation.ValidationException>

  Version:
    $Revision: 1.1 $ Created Mar 31, 2012
  Author:
    Ron Sigal

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResteasyViolationExceptionMapper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Response` | `buildResponse(Object entity, String mediaType, Response.Status status)`
    `protected Response` | `buildViolationReportResponse(ResteasyViolationException exception, Response.Status status)`
    `Response` | `toResponse(javax.validation.ValidationException exception)` Map an exception to a `Response`.
    `protected String` | `unwrapException(Throwable t)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ResteasyViolationExceptionMapper

          public ResteasyViolationExceptionMapper()

  - ### Method Detail

    - #### toResponse

          public Response toResponse(javax.validation.ValidationException exception)

      Description copied from interface: `ExceptionMapper`
      Map an exception to a `Response`. Returning `null` results in a `Response.Status.NO_CONTENT` response. Throwing a runtime exception results in a `Response.Status.INTERNAL_SERVER_ERROR` response.
      Specified by:
        `toResponse` in interface `ExceptionMapper<javax.validation.ValidationException>`
      Parameters:
        `exception` - the exception to map to a response.
      Returns:
        a response mapped from the supplied exception.

    - #### buildResponse

          protected Response buildResponse(Object entity,
                               String mediaType,
                               Response.Status status)

    - #### buildViolationReportResponse

          protected Response buildViolationReportResponse(ResteasyViolationException exception,
                                              Response.Status status)

    - #### unwrapException

          protected String unwrapException(Throwable t)

Copyright © 2014. All Rights Reserved.