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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(JsonValue jsonValue, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) voidwriteTo(JsonValue jsonValue, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> stringObjectMultivaluedMap, OutputStream outputStream)
-
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:
isWriteablein interfacejavax.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:
getSizein interfacejavax.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:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<JsonValue>- Throws:
IOExceptionjavax.ws.rs.WebApplicationException
-