public class CsvResponseWriter extends Object implements ResponseWriter
Constructor and Description |
---|
CsvResponseWriter(ObjectMappersSuite objectMappers)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
com.fasterxml.jackson.dataformat.csv.CsvSchema |
buildCsvHeaders(ResponseData responseData)
Builds the CSV header.
|
void |
write(ApiRequest request,
ResponseData responseData,
OutputStream outputStream)
Serializes the ResultSet (pulled from the ResponseData) and any desired metadata and adds it to the specified
output stream.
|
public CsvResponseWriter(ObjectMappersSuite objectMappers)
objectMappers
- ObjectMappersSuite object needed for CsvMapperpublic void write(ApiRequest request, ResponseData responseData, OutputStream outputStream) throws IOException
ResponseWriter
write
in interface ResponseWriter
request
- ApiRequest object with all the associated info in itresponseData
- Data object containing all the result informationoutputStream
- OutputStreamIOException
- if a problem is encountered writing to the OutputStreampublic com.fasterxml.jackson.dataformat.csv.CsvSchema buildCsvHeaders(ResponseData responseData)
responseData
- Data object containing all the result informationCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.