Package org.glassfish.json.jaxrs1x
Class JsonStructureBodyReader
- java.lang.Object
-
- org.glassfish.json.jaxrs1x.JsonStructureBodyReader
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<JsonStructure>
@Provider @Consumes({"application/json","text/json","*/*"}) public class JsonStructureBodyReader extends java.lang.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 Modifier and Type Field Description private static java.lang.String
JSON
private static java.lang.String
PLUS_JSON
private JsonReaderFactory
rf
-
Constructor Summary
Constructors Constructor Description JsonStructureBodyReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isReadable(java.lang.Class<?> aClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
JsonStructure
readFrom(java.lang.Class<JsonStructure> jsonStructureClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> stringStringMultivaluedMap, java.io.InputStream inputStream)
private static boolean
supportsMediaType(javax.ws.rs.core.MediaType mediaType)
-
-
-
Field Detail
-
rf
private final JsonReaderFactory rf
-
JSON
private static final java.lang.String JSON
- See Also:
- Constant Field Values
-
PLUS_JSON
private static final java.lang.String PLUS_JSON
- See Also:
- Constant Field Values
-
-
Method Detail
-
isReadable
public boolean isReadable(java.lang.Class<?> aClass, java.lang.reflect.Type type, java.lang.annotation.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(java.lang.Class<JsonStructure> jsonStructureClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> stringStringMultivaluedMap, java.io.InputStream inputStream) throws java.io.IOException, javax.ws.rs.WebApplicationException
- Specified by:
readFrom
in interfacejavax.ws.rs.ext.MessageBodyReader<JsonStructure>
- Throws:
java.io.IOException
javax.ws.rs.WebApplicationException
-
-