Class JsonValueBodyWriter

java.lang.Object
org.glassfish.json.jaxrs.JsonValueBodyWriter
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<JsonValue>

@Provider @Produces({"application/json","text/json","*/*"}) public class JsonValueBodyWriter extends Object implements javax.ws.rs.ext.MessageBodyWriter<JsonValue>
JAX-RS MessageBodyWriter for JsonValue. This allows JsonValue to be return type of a resource method.
Author:
Jitendra Kotamraju, Blaise Doughan, Michal Gajdos
  • Constructor Details

    • JsonValueBodyWriter

      public JsonValueBodyWriter()
  • Method Details

    • isWriteable

      public boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<JsonValue>
    • getSize

      public long getSize(JsonValue jsonValue, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      getSize in interface javax.ws.rs.ext.MessageBodyWriter<JsonValue>
    • writeTo

      public void writeTo(JsonValue jsonValue, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> stringObjectMultivaluedMap, OutputStream outputStream) throws IOException, javax.ws.rs.WebApplicationException
      Specified by:
      writeTo in interface javax.ws.rs.ext.MessageBodyWriter<JsonValue>
      Throws:
      IOException
      javax.ws.rs.WebApplicationException