Class JsrMessageBodyWriter

  • All Implemented Interfaces:
    jakarta.ws.rs.ext.MessageBodyWriter<jakarta.json.JsonStructure>

    @Produces({"application/json","*/json","*/*+json","*/x-json","*/javascript","*/x-javascript"})
    public class JsrMessageBodyWriter
    extends Object
    implements jakarta.ws.rs.ext.MessageBodyWriter<jakarta.json.JsonStructure>
    • Field Detail

      • factory

        private final jakarta.json.JsonWriterFactory factory
      • close

        private final boolean close
    • Constructor Detail

      • JsrMessageBodyWriter

        public JsrMessageBodyWriter()
      • JsrMessageBodyWriter

        public JsrMessageBodyWriter​(jakarta.json.JsonWriterFactory factory,
                                    boolean closeStreams)
    • Method Detail

      • isWriteable

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

        public long getSize​(jakarta.json.JsonStructure jsonStructure,
                            Class<?> aClass,
                            Type type,
                            Annotation[] annotations,
                            jakarta.ws.rs.core.MediaType mediaType)
        Specified by:
        getSize in interface jakarta.ws.rs.ext.MessageBodyWriter<jakarta.json.JsonStructure>
      • writeTo

        public void writeTo​(jakarta.json.JsonStructure jsonStructure,
                            Class<?> aClass,
                            Type type,
                            Annotation[] annotations,
                            jakarta.ws.rs.core.MediaType mediaType,
                            jakarta.ws.rs.core.MultivaluedMap<String,​Object> stringObjectMultivaluedMap,
                            OutputStream outputStream)
                     throws IOException,
                            jakarta.ws.rs.WebApplicationException
        Specified by:
        writeTo in interface jakarta.ws.rs.ext.MessageBodyWriter<jakarta.json.JsonStructure>
        Throws:
        IOException
        jakarta.ws.rs.WebApplicationException