Class AbstractWriter<E>

java.lang.Object
fr.paris.lutece.plugins.rest.service.writers.AbstractWriter<E>
Type Parameters:
E - the real object class
All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyWriter<List<E>>

public abstract class AbstractWriter<E> extends Object implements jakarta.ws.rs.ext.MessageBodyWriter<List<E>>
This class handle the action of formatting an object E to String with the appropriate MediaType.
  • Constructor Details

    • AbstractWriter

      public AbstractWriter()
  • Method Details

    • setFormatters

      public void setFormatters(Map<String,IFormatter<E>> mapFormatters)
      Set the formatters
      Parameters:
      mapFormatters - the formatters
    • getSize

      public long getSize(List<E> resource, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      getSize in interface jakarta.ws.rs.ext.MessageBodyWriter<E>
    • writeTo

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