Package org.glassfish.json.jaxrs
Class JsonStructureBodyReader
java.lang.Object
org.glassfish.json.jaxrs.JsonStructureBodyReader
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<JsonStructure>
@Provider
@Consumes({"application/json","text/json","*/*"})
public class JsonStructureBodyReader
extends Object
implements javax.ws.rs.ext.MessageBodyReader<JsonStructure>
JAX-RS MessageBodyReader for JsonStructure. This allows
JsonStructure, JsonArray and JsonObject to be a parameter of a
resource method.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isReadable
(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) readFrom
(Class<JsonStructure> jsonStructureClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, String> stringStringMultivaluedMap, InputStream inputStream) private static boolean
supportsMediaType
(javax.ws.rs.core.MediaType mediaType)
-
Field Details
-
rf
-
JSON
- See Also:
-
PLUS_JSON
- See Also:
-
-
Constructor Details
-
JsonStructureBodyReader
public JsonStructureBodyReader()
-
-
Method Details
-
isReadable
public boolean isReadable(Class<?> aClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
isReadable
in interfacejavax.ws.rs.ext.MessageBodyReader<JsonStructure>
-
supportsMediaType
private static boolean supportsMediaType(javax.ws.rs.core.MediaType mediaType) - Returns:
- true for all media types of the pattern */json and */*+json.
-
readFrom
public JsonStructure readFrom(Class<JsonStructure> jsonStructureClass, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, String> stringStringMultivaluedMap, InputStream inputStream) throws IOException, javax.ws.rs.WebApplicationException- Specified by:
readFrom
in interfacejavax.ws.rs.ext.MessageBodyReader<JsonStructure>
- Throws:
IOException
javax.ws.rs.WebApplicationException
-