Package org.glassfish.json.jaxrs
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
getSize
(JsonValue jsonValue, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) private void
init()
boolean
isWriteable
(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) private static boolean
supportsMediaType
(javax.ws.rs.core.MediaType mediaType) 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)
-
Field Details
-
JSON
- See Also:
-
PLUS_JSON
- See Also:
-
wf
-
config
@Context private javax.ws.rs.core.Configuration config
-
-
Constructor Details
-
JsonValueBodyWriter
public JsonValueBodyWriter()
-
-
Method Details
-
init
-
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<JsonValue>
-
supportsMediaType
private static boolean supportsMediaType(javax.ws.rs.core.MediaType mediaType) - Returns:
- true for all media types of the pattern */json and */*+json.
-
getSize
public long getSize(JsonValue jsonValue, Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
getSize
in 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:
writeTo
in interfacejavax.ws.rs.ext.MessageBodyWriter<JsonValue>
- Throws:
IOException
javax.ws.rs.WebApplicationException
-