@Produces(value="text/tab-separated-values") @Provider public class ResultSetTsvMessageBodyWriter extends Object implements javax.ws.rs.ext.MessageBodyWriter<ResultSet>
ResultSet
. Resulting output is tsv and
conforms to:
http://www.w3.org/TR/2013/REC-sparql11-results-csv-tsv-20130321/#tsv
Also see: http://www.iana.org/assignments/media-types/text/tab-separated-values
Constructor and Description |
---|
ResultSetTsvMessageBodyWriter() |
Modifier and Type | Method and Description |
---|---|
long |
getSize(ResultSet t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
protected String |
getTextEncoding() |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
void |
setTextEncoding(String textEncoding)
Sets the text encoding for the resource.
|
void |
writeTo(ResultSet resultSet,
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<ResultSet>
public long getSize(ResultSet t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<ResultSet>
public void writeTo(ResultSet resultSet, 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
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<ResultSet>
IOException
javax.ws.rs.WebApplicationException
public void setTextEncoding(String textEncoding) throws UnsupportedEncodingException
textEncoding
- character encoding of text bodyUnsupportedEncodingException
- when the given encoding is not supported.protected String getTextEncoding()
Copyright © 2015–2022 The Apache Software Foundation. All rights reserved.