Class JohnzonMessageBodyWriter<T>

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

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

      • mapper

        private final Mapper mapper
    • Constructor Detail

      • JohnzonMessageBodyWriter

        public JohnzonMessageBodyWriter()
      • JohnzonMessageBodyWriter

        public JohnzonMessageBodyWriter​(Mapper mapper,
                                        Collection<String> ignoredTypes)
    • Method Detail

      • getSize

        public long getSize​(T t,
                            Class<?> rawType,
                            Type genericType,
                            Annotation[] annotations,
                            jakarta.ws.rs.core.MediaType mediaType)
        Specified by:
        getSize in interface jakarta.ws.rs.ext.MessageBodyWriter<T>
      • isWriteable

        public boolean isWriteable​(Class<?> rawType,
                                   Type genericType,
                                   Annotation[] annotations,
                                   jakarta.ws.rs.core.MediaType mediaType)
        Specified by:
        isWriteable in interface jakarta.ws.rs.ext.MessageBodyWriter<T>
      • writeTo

        public void writeTo​(T t,
                            Class<?> rawType,
                            Type genericType,
                            Annotation[] annotations,
                            jakarta.ws.rs.core.MediaType mediaType,
                            jakarta.ws.rs.core.MultivaluedMap<String,​Object> httpHeaders,
                            OutputStream entityStream)
                     throws IOException
        Specified by:
        writeTo in interface jakarta.ws.rs.ext.MessageBodyWriter<T>
        Throws:
        IOException