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 Details

  • 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 interface javax.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 interface javax.ws.rs.ext.MessageBodyReader<JsonStructure>
      Throws:
      IOException
      javax.ws.rs.WebApplicationException