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:
javax.ws.rs.ext.MessageBodyWriter<List<E>>
public abstract class AbstractWriter<E> extends Object implements javax.ws.rs.ext.MessageBodyWriter<List<E>>
This class handle the action of formatting an object E to String with the appropriate MediaType.
-
-
Constructor Summary
Constructors Constructor Description AbstractWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetSize(List<E> resource, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)voidsetFormatters(Map<String,IFormatter<E>> mapFormatters)Set the formattersvoidwriteTo(List<E> listResources, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
-
-
-
Method Detail
-
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, javax.ws.rs.core.MediaType mediaType)
- Specified by:
getSizein interfacejavax.ws.rs.ext.MessageBodyWriter<E>
-
writeTo
public void writeTo(List<E> listResources, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException
- Specified by:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<E>- Throws:
IOExceptionjavax.ws.rs.WebApplicationException
-
-