Class JohnzonMessageBodyWriter<T>

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

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

      Fields 
      Modifier and Type Field Description
      private org.apache.johnzon.mapper.Mapper mapper  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getSize​(T t, java.lang.Class<?> rawType, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)  
      boolean isWriteable​(java.lang.Class<?> rawType, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)  
      void writeTo​(T t, java.lang.Class<?> rawType, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> httpHeaders, java.io.OutputStream entityStream)  
      • Methods inherited from class java.lang.Object

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

      • mapper

        private final org.apache.johnzon.mapper.Mapper mapper
    • Constructor Detail

      • JohnzonMessageBodyWriter

        public JohnzonMessageBodyWriter()
      • JohnzonMessageBodyWriter

        public JohnzonMessageBodyWriter​(org.apache.johnzon.mapper.Mapper mapper,
                                        java.util.Collection<java.lang.String> ignoredTypes)
    • Method Detail

      • getSize

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

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

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