Class MessageBodyReaders.CachingDelegatingMessageBodyReader

  • All Implemented Interfaces:
    jakarta.ws.rs.ext.MessageBodyReader<Object>
    Direct Known Subclasses:
    MessageBodyReaders.CachingJsonMessageBodyReader
    Enclosing class:
    MessageBodyReaders

    public abstract static class MessageBodyReaders.CachingDelegatingMessageBodyReader
    extends Object
    implements jakarta.ws.rs.ext.MessageBodyReader<Object>
    Caches the deserialized request body in the ContainerRequestContext for use later in the request lifecycle.

    This makes the request body accessible to any Jersey response filters or interceptors.

    See Also:
    PostRequestLoggingFilter
    • Constructor Detail

      • CachingDelegatingMessageBodyReader

        public CachingDelegatingMessageBodyReader()
    • Method Detail

      • getDelegate

        public abstract jakarta.ws.rs.ext.MessageBodyReader<Object> getDelegate()
      • isReadable

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

        public Object readFrom​(Class<Object> type,
                               Type genericType,
                               Annotation[] annotations,
                               jakarta.ws.rs.core.MediaType mediaType,
                               jakarta.ws.rs.core.MultivaluedMap<String,​String> httpHeaders,
                               InputStream entityStream)
                        throws IOException,
                               jakarta.ws.rs.WebApplicationException
        Specified by:
        readFrom in interface jakarta.ws.rs.ext.MessageBodyReader<Object>
        Throws:
        IOException
        jakarta.ws.rs.WebApplicationException