com.holonplatform.json.gson.jaxrs.internal

## Class GsonJsonProvider

- java.lang.Object
- - com.holonplatform.json.gson.jaxrs.internal.GsonJsonProvider

- All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<Object>, javax.ws.rs.ext.MessageBodyWriter<Object>

      @Produces(value="application/json")
       @Consumes(value="application/json")
      public class GsonJsonProvider
      extends Object
      implements javax.ws.rs.ext.MessageBodyWriter<Object>, javax.ws.rs.ext.MessageBodyReader<Object>

  JAX-RS message body reader and writer using `Gson` as JSON serializer/deserializer.
  Since:
    5.0.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GsonJsonProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getSize(Object t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)`
    `boolean` | `isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)`
    `boolean` | `isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)`
    `Object` | `readFrom(Class<Object> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream)`
    `void` | `writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)`

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

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

- - ### Constructor Detail

    - #### GsonJsonProvider

          public GsonJsonProvider()

  - ### Method Detail

    - #### isReadable

          public boolean isReadable(Class<?> type,
                                    Type genericType,
                                    Annotation[] annotations,
                                    javax.ws.rs.core.MediaType mediaType)

      Specified by:
        `isReadable` in interface `javax.ws.rs.ext.MessageBodyReader<Object>`

    - #### readFrom

          public Object readFrom(Class<Object> type,
                                 Type genericType,
                                 Annotation[] annotations,
                                 javax.ws.rs.core.MediaType mediaType,
                                 javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
                                 InputStream entityStream)
                          throws IOException,
                                 javax.ws.rs.WebApplicationException

      Specified by:
        `readFrom` in interface `javax.ws.rs.ext.MessageBodyReader<Object>`
      Throws:
        `IOException`
        `javax.ws.rs.WebApplicationException`

    - #### isWriteable

          public boolean isWriteable(Class<?> type,
                                     Type genericType,
                                     Annotation[] annotations,
                                     javax.ws.rs.core.MediaType mediaType)

      Specified by:
        `isWriteable` in interface `javax.ws.rs.ext.MessageBodyWriter<Object>`

    - #### getSize

          public long getSize(Object t,
                              Class<?> type,
                              Type genericType,
                              Annotation[] annotations,
                              javax.ws.rs.core.MediaType mediaType)

      Specified by:
        `getSize` in interface `javax.ws.rs.ext.MessageBodyWriter<Object>`

    - #### writeTo

          public void writeTo(Object t,
                              Class<?> type,
                              Type genericType,
                              Annotation[] annotations,
                              javax.ws.rs.core.MediaType mediaType,
                              javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
                              OutputStream entityStream)
                       throws IOException,
                              javax.ws.rs.WebApplicationException

      Specified by:
        `writeTo` in interface `javax.ws.rs.ext.MessageBodyWriter<Object>`
      Throws:
        `IOException`
        `javax.ws.rs.WebApplicationException`

Copyright © 2019 The Holon Platform. All rights reserved.