@Produces(value={"text/plain","text/csv"}) public final class CSVMessageBodyWriter extends Object implements javax.ws.rs.ext.MessageBodyWriter<Object>
MessageBodyWriter
that can produce CSV (text/csv
). If given an
Iterable
, produces a line of CSV for each element. If an element implements
HasCSV
then HasCSV.toCSV()
is used to compute its CSV representation; otherwise
Object.toString()
is.Constructor and Description |
---|
CSVMessageBodyWriter() |
Modifier and Type | Method and Description |
---|---|
long |
getSize(Object o,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
void |
writeTo(Object o,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream) |
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<Object>
public long getSize(Object o, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<Object>
public void writeTo(Object o, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<Object>
IOException
Copyright © 2014–2018. All rights reserved.