class JsonResponseArguments extends ResponseArguments
Modifier and Type | Field and Description |
---|---|
private boolean |
hasArgs
Flag identifying if any JSON arguments were written.
|
private com.fasterxml.jackson.databind.node.ObjectNode |
jsonResponse
The JSON 'response' element - here any JSON arguments will be attached.
|
private com.fasterxml.jackson.databind.node.ObjectNode |
root
The root JSON element.
|
Constructor and Description |
---|
JsonResponseArguments()
Initialize this instance by creating the
{ "response": {} } JSON. |
Modifier and Type | Method and Description |
---|---|
protected void |
flushArguments(java.io.OutputStream stream,
javax.servlet.http.HttpServletResponse response)
Flush the arguments to the response stream (i.e.
|
protected boolean |
ignoreUnknown()
Determine if unknown values must be ignored.
|
protected void |
writeArgumentInt(java.io.OutputStream stream,
java.lang.String target,
java.lang.String sval,
java.lang.Object val,
javax.servlet.http.HttpServletResponse response)
Serialize this argument's value, considering the target format.
|
protected java.lang.Object |
writeDataSet(java.lang.String target,
DataSetContainer val)
Serialize the specified dataset.
|
java.lang.String |
writeError(LegacyError err)
Serialize the error, to be included in the response.
|
protected void |
writeExtentArgument(java.io.OutputStream stream,
java.lang.String target,
java.lang.Object val,
javax.servlet.http.HttpServletResponse response)
Serialize this argument's values, considering the target format.
|
private void |
writeTable(com.fasterxml.jackson.databind.node.ArrayNode table,
java.util.List<PropertyDefinition> props,
java.util.List<java.lang.Object[]> rows)
Write the specified table to JSON.
|
protected java.lang.Object |
writeTable(java.lang.String target,
TableWrapper val)
Serialize the specified result-set.
|
toString, writeArgument, writeArguments, writeArguments, writeArguments, writeDataSet
private final com.fasterxml.jackson.databind.node.ObjectNode root
private final com.fasterxml.jackson.databind.node.ObjectNode jsonResponse
private boolean hasArgs
public JsonResponseArguments()
{ "response": {} }
JSON.public java.lang.String writeError(LegacyError err)
writeError
in class ResponseArguments
err
- The error.protected boolean ignoreUnknown()
ignoreUnknown
in class ResponseArguments
true
protected void writeExtentArgument(java.io.OutputStream stream, java.lang.String target, java.lang.Object val, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
writeExtentArgument
in class ResponseArguments
stream
- The response stream.target
- The argument's encoded target.val
- The argument's value.response
- The HTTP response.java.io.IOException
protected void writeArgumentInt(java.io.OutputStream stream, java.lang.String target, java.lang.String sval, java.lang.Object val, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
writeArgumentInt
in class ResponseArguments
stream
- The response stream.target
- The argument's encoded target.sval
- The argument's string-converted value.val
- The argument's value.response
- The HTTP response.java.io.IOException
protected void flushArguments(java.io.OutputStream stream, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
flushArguments
in class ResponseArguments
stream
- The stream to write the parameters.response
- The servlet response.java.io.IOException
protected java.lang.Object writeTable(java.lang.String target, TableWrapper val)
writeTable
in class ResponseArguments
target
- The target OUTPUT parameter.val
- The table result set, as received from the remote side.protected java.lang.Object writeDataSet(java.lang.String target, DataSetContainer val)
writeDataSet
in class ResponseArguments
target
- The target OUTPUT parameter.val
- The dataset, as received from the remote side.private void writeTable(com.fasterxml.jackson.databind.node.ArrayNode table, java.util.List<PropertyDefinition> props, java.util.List<java.lang.Object[]> rows)
table
- The JSON structure.props
- The table properties.rows
- The table data.