public abstract class EndpointServlet extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ObjectMappersSuite |
objectMappers |
| Constructor and Description |
|---|
EndpointServlet(ObjectMappersSuite objectMappers)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected <T> javax.ws.rs.core.Response |
formatResponse(ApiRequest apiRequest,
Stream<T> rows,
String jsonName,
List<String> csvColumnNames)
Format and build the response as JSON or CSV.
|
protected final ObjectMappersSuite objectMappers
@Inject public EndpointServlet(ObjectMappersSuite objectMappers)
objectMappers - Shared JSON toolsprotected <T> javax.ws.rs.core.Response formatResponse(ApiRequest apiRequest, Stream<T> rows, String jsonName, List<String> csvColumnNames)
T - The type of rows being processedapiRequest - The api request objectrows - The stream that describes the data to be formattedjsonName - Top-level title for the JSON datacsvColumnNames - Header for the CSV dataCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.