Package org.glassfish.json.jaxrs
Class JsonStructureBodyWriter
- java.lang.Object
-
- org.glassfish.json.jaxrs.JsonStructureBodyWriter
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<JsonStructure>
@Provider @Produces({"application/json","text/json","*/*"}) public class JsonStructureBodyWriter extends Object implements javax.ws.rs.ext.MessageBodyWriter<JsonStructure>
JAX-RS MessageBodyWriter for JsonStructure. This allows JsonStructure, JsonArray and JsonObject to be return type of a resource method.- Author:
- Jitendra Kotamraju, Blaise Doughan, Michal Gajdos
-
-
Constructor Summary
Constructors Constructor Description JsonStructureBodyWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getSize(JsonStructure jsonStructure, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
boolean
isWriteable(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
void
writeTo(JsonStructure jsonStructure, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> stringObjectMultivaluedMap, OutputStream outputStream)
-
-
-
Method Detail
-
isWriteable
public boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
isWriteable
in interfacejavax.ws.rs.ext.MessageBodyWriter<JsonStructure>
-
getSize
public long getSize(JsonStructure jsonStructure, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
getSize
in interfacejavax.ws.rs.ext.MessageBodyWriter<JsonStructure>
-
writeTo
public void writeTo(JsonStructure jsonStructure, 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 interfacejavax.ws.rs.ext.MessageBodyWriter<JsonStructure>
- Throws:
IOException
javax.ws.rs.WebApplicationException
-
-