Example usage for org.springframework.web HttpMediaTypeNotSupportedException getClass

List of usage examples for org.springframework.web HttpMediaTypeNotSupportedException getClass

Introduction

In this page you can find the example usage for org.springframework.web HttpMediaTypeNotSupportedException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:br.com.modoagil.asr.rest.support.RESTErrorHandler.java

/**
 * Manipula exceo para status HTTP {@code 415}
 *
 * @param ex/*from   w ww .  j a  v  a 2 s.c o  m*/
 *            {@link HttpMediaTypeNotSupportedException}
 * @return resposta ao cliente
 */
@ResponseBody
@ExceptionHandler(HttpMediaTypeNotSupportedException.class)
public Response<E> processHttpMediaTypeNotSupportedException(final HttpMediaTypeNotSupportedException ex) {
    this.logger.info("handleHttpMediaTypeNotSupportedException - Catching: " + ex.getClass().getSimpleName(),
            ex);
    return new ResponseBuilder<E>().success(false).message(ex.getContentType().getType() + " not supported")
            .status(HttpStatus.UNSUPPORTED_MEDIA_TYPE).build();
}