public class JsonResponseSerializer extends Object implements ResponseSerializer
Constructor and Description |
---|
JsonResponseSerializer() |
Modifier and Type | Method and Description |
---|---|
String |
getSupportedMediaType()
Returns supported media type.
|
String |
serializeReadFlat(SqlResource sqlResource,
ResultSet resultSet)
Converts flat select results to a JSON array.
|
String |
serializeReadHierarchical(SqlResource sqlResource,
List<Map<String,Object>> results)
Converts hierarchical select results to a JSON array.
|
String |
serializeWrite(SqlResource sqlResource,
WriteResponse response)
Converts write results to a JSON object.
|
public String getSupportedMediaType()
ResponseSerializer
getSupportedMediaType
in interface ResponseSerializer
public String serializeReadFlat(SqlResource sqlResource, ResultSet resultSet) throws SQLException
serializeReadFlat
in interface ResponseSerializer
sqlResource
- SQL resourceresultSet
- resultsSQLException
public String serializeReadHierarchical(SqlResource sqlResource, List<Map<String,Object>> results)
serializeReadHierarchical
in interface ResponseSerializer
sqlResource
- SQL resourceresults
- resultspublic String serializeWrite(SqlResource sqlResource, WriteResponse response)
serializeWrite
in interface ResponseSerializer
response
- responsesqlResource
- SQL resourceCopyright © 2011-2018 restSQL Project Contributors