Class JsonMapper

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<Object>, javax.ws.rs.ext.MessageBodyWriter<Object>

    @Provider
    @Consumes({"application/json","text/json"})
    @Produces({"application/json","text/json"})
    public class JsonMapper
    extends Object
    • Field Detail

      • log

        protected final Logger log
      • objectMapper

        protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • Constructor Detail

      • JsonMapper

        @Inject
        public JsonMapper​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • Method Detail

      • setUriInfo

        @Context
        public void setUriInfo​(javax.ws.rs.core.UriInfo uriInfo)
      • getReaderJsonFactory

        protected com.fasterxml.jackson.core.JsonFactory getReaderJsonFactory()
      • isReadable

        public boolean isReadable​(Class<?> type,
                                  Type genericType,
                                  Annotation[] annotations,
                                  javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isReadable in interface javax.ws.rs.ext.MessageBodyReader<Object>
      • isWriteable

        public boolean isWriteable​(Class<?> type,
                                   Type genericType,
                                   Annotation[] annotations,
                                   javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Object>
      • getSize

        public long getSize​(Object value,
                            Class<?> type,
                            Type genericType,
                            Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType)
        Specified by:
        getSize in interface javax.ws.rs.ext.MessageBodyWriter<Object>