fr.paris.lutece.plugins.rest.service.writers
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<java.util.List<E>>
public abstract class AbstractWriter<E>
- extends java.lang.Object
- implements javax.ws.rs.ext.MessageBodyWriter<java.util.List<E>>
This class handle the action of formatting an object E to String with the appropriate
MediaType.
|
Method Summary |
long |
getSize(java.util.List<E> resource,
java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
|
void |
setFormatters(java.util.Map<java.lang.String,IFormatter<E>> mapFormatters)
Set the formatters |
void |
writeTo(java.util.List<E> listResources,
java.lang.Class<?> type,
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 |
| Methods inherited from interface javax.ws.rs.ext.MessageBodyWriter |
isWriteable |
AbstractWriter
public AbstractWriter()
setFormatters
public void setFormatters(java.util.Map<java.lang.String,IFormatter<E>> mapFormatters)
- Set the formatters
- Parameters:
mapFormatters - the formatters
getSize
public long getSize(java.util.List<E> resource,
java.lang.Class<?> type,
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<java.util.List<E>>
writeTo
public void writeTo(java.util.List<E> listResources,
java.lang.Class<?> type,
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,
javax.ws.rs.WebApplicationException
-
- Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<java.util.List<E>>
- Throws:
java.io.IOException
javax.ws.rs.WebApplicationException
Copyright © 2012 Mairie de Paris. All Rights Reserved.