public abstract class ServiceArgumentsParser
extends java.lang.Object
| Constructor and Description |
|---|
ServiceArgumentsParser() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
assignArgument(int idx,
BaseDataType bdt,
java.lang.String sval)
Assign the given argument to the specified value.
|
protected DatasetWrapper |
createDataset(java.lang.String name,
boolean input,
boolean output,
boolean asHandle)
Create a new
DatasetWrapper. |
protected TableWrapper |
createTable(java.lang.String name,
boolean input,
boolean output,
boolean asHandle)
Create a new
TableWrapper. |
protected abstract DatasetWrapper |
loadDataSet(java.lang.String content)
Load the specified dataset.
|
protected abstract TableWrapper |
loadTable(java.lang.String content)
Load the specified table.
|
protected void |
notAValue(BaseDataType bdt,
java.lang.String val)
Raises an error so that the request stops with a 5xx internal server error.
|
protected abstract java.lang.String |
parseArgumentInt(java.lang.String body,
java.lang.String source,
javax.servlet.http.HttpServletRequest request)
Parse the argument, by interpreting the request.
|
java.lang.Object[] |
parseArguments(ArgumentsParser parser,
LegacyServiceParameter[] serviceParameters,
LegacyServiceParameter[] original,
javax.servlet.http.HttpServletRequest request)
Parse the arguments, by interpreting the request.
|
java.lang.Object[] |
parseArguments(LegacyServiceParameter[] serviceParameters,
LegacyServiceParameter[] original,
javax.servlet.http.HttpServletRequest request)
Parse the arguments, by interpreting the request.
|
java.lang.Object[] |
parseArguments(RestService service,
javax.servlet.http.HttpServletRequest request)
Parse the arguments, by interpreting the request.
|
protected abstract java.lang.Object[] |
parseExtentArgument(java.lang.String body,
javax.servlet.http.HttpServletRequest request,
int idx,
java.lang.String source,
java.lang.String type,
int extent)
Parse an extent argument.
|
(package private) BaseDataType |
unknownInstance(java.lang.String type)
Generate an unknown instance for the given type.
|
protected abstract java.lang.Object[] parseExtentArgument(java.lang.String body,
javax.servlet.http.HttpServletRequest request,
int idx,
java.lang.String source,
java.lang.String type,
int extent)
throws RequestArgumentError
body - The HTTP body.request - The request payload.idx - The argument's index.source - The arguments's source.type - The arguments's type.extent - The arguments's length.RequestArgumentErrorprotected abstract void assignArgument(int idx,
BaseDataType bdt,
java.lang.String sval)
throws RequestArgumentError
idx - The argument's index.bdt - The argument's BaseDataType instance (may be null).sval - The string representation of this argument.RequestArgumentErrorprotected abstract java.lang.String parseArgumentInt(java.lang.String body,
java.lang.String source,
javax.servlet.http.HttpServletRequest request)
throws java.io.IOException
body - The request body.source - The parameter's encoded source.request - The request payload.java.io.IOExceptionprotected abstract TableWrapper loadTable(java.lang.String content) throws java.io.IOException, RequestArgumentError
content - The table definition.TableWrapper instance to be passed as argument to the remote call.java.io.IOExceptionRequestArgumentErrorprotected abstract DatasetWrapper loadDataSet(java.lang.String content) throws java.io.IOException, RequestArgumentError
content - The dataset definition.DatasetWrapper instance to be passed as argument to the remote call.java.io.IOExceptionRequestArgumentErrorprotected DatasetWrapper createDataset(java.lang.String name, boolean input, boolean output, boolean asHandle)
DatasetWrapper. This implementation by default returns null.name - The dataset name.input - The INPUT mode.output - The OUTPUT mode.asHandle - Flag indicating if this is a DATASET-HANDLE parameter.null by default.protected TableWrapper createTable(java.lang.String name, boolean input, boolean output, boolean asHandle)
TableWrapper. This implementation by default returns null.name - The table name.input - The INPUT mode.output - The OUTPUT mode.asHandle - Flag indicating if this is a DATASET-HANDLE parameter.null by default.public final java.lang.Object[] parseArguments(RestService service, javax.servlet.http.HttpServletRequest request) throws java.io.IOException, RequestArgumentError
For OUTPUT, they will be set to default value. For INPUT, they will be resolved from the request.
service - The service definition.request - The request payload.java.io.IOExceptionRequestArgumentErrorpublic final java.lang.Object[] parseArguments(LegacyServiceParameter[] serviceParameters, LegacyServiceParameter[] original, javax.servlet.http.HttpServletRequest request) throws java.io.IOException, RequestArgumentError
For OUTPUT, they will be set to default value. For INPUT, they will be resolved from the request.
serviceParameters - The legacy service definition parameters.original - The definition parameters.request - The request payload.java.io.IOExceptionRequestArgumentErrorpublic final java.lang.Object[] parseArguments(ArgumentsParser parser, LegacyServiceParameter[] serviceParameters, LegacyServiceParameter[] original, javax.servlet.http.HttpServletRequest request) throws java.io.IOException, RequestArgumentError
For OUTPUT, they will be set to default value. For INPUT, they will be resolved from the request.
parser - The parser to be used for parsing the argumentsserviceParameters - The legacy service definition parameters.original - The definition parameters.request - The request payload.java.io.IOExceptionRequestArgumentErrorprotected void notAValue(BaseDataType bdt, java.lang.String val) throws RequestArgumentError
bdt - The BDT for which the value could not be parsed.val - The attempted value to assign.RequestArgumentErrorBaseDataType unknownInstance(java.lang.String type)
type - The parameter's type.