Class JsonValueBodyReader

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<JsonValue>

    @Provider
    @Consumes({"application/json","text/json","*/*"})
    public class JsonValueBodyReader
    extends java.lang.Object
    implements javax.ws.rs.ext.MessageBodyReader<JsonValue>
    JAX-RS MessageBodyReader for JsonValue. This allows JsonValue 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  
    • 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)  
      JsonValue readFrom​(java.lang.Class<JsonValue> jsonValueClass, 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonValueBodyReader

        public JsonValueBodyReader()
    • 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 interface javax.ws.rs.ext.MessageBodyReader<JsonValue>
      • 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 JsonValue readFrom​(java.lang.Class<JsonValue> jsonValueClass,
                                  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 interface javax.ws.rs.ext.MessageBodyReader<JsonValue>
        Throws:
        java.io.IOException
        javax.ws.rs.WebApplicationException