Class 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  
    • 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)  
      • Methods inherited from class java.lang.Object

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

      • JsonStructureBodyReader

        public JsonStructureBodyReader()
    • 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<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 interface javax.ws.rs.ext.MessageBodyReader<JsonStructure>
        Throws:
        java.io.IOException
        javax.ws.rs.WebApplicationException