public class CallParameter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
argument
The prepared argument which will be passed to the remote call.
|
java.lang.String |
dataType
|
java.lang.Object |
initialValue
The original input for value parameter passed to
Call.setParameter(com.goldencode.p2j.util.int64, com.goldencode.p2j.util.character, com.goldencode.p2j.util.character, java.lang.Object) . |
CallMode |
mode
|
java.lang.Object |
value
|
Constructor and Description |
---|
CallParameter(java.lang.String dataType,
boolean isClass,
CallMode mode,
java.lang.Object value)
Create a new wrapper for a parameter which will be used for a native OS API call.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
convertTo()
Convert this parameter's
value to be usable as an argument. |
private BaseDataType |
convertTo(BaseDataType val,
java.lang.Class<?> type)
Convert the given BDT instance to the specified type.
|
java.lang.Object |
convertTo(java.lang.Class<?> cls)
Convert this parameter's
value to be usable as an argument. |
private java.lang.Object |
convertValue(java.lang.String dataType,
boolean isClass,
CallMode mode,
java.lang.Object value)
Make a copy of this parameter's
value for input/input-output parameters. |
boolean |
copyOutput()
If this parameter is an OUTPUT or INPUT-OUTPUT non-table parameter, copy the value to
the variable or field, as specified via
SET-PARAMETER . |
java.lang.Object |
getArgument()
Get the argument.
|
public final java.lang.Object value
public final java.lang.Object initialValue
Call.setParameter(com.goldencode.p2j.util.int64, com.goldencode.p2j.util.character, com.goldencode.p2j.util.character, java.lang.Object)
.public final CallMode mode
public final java.lang.String dataType
protected java.lang.Object argument
public CallParameter(java.lang.String dataType, boolean isClass, CallMode mode, java.lang.Object value)
dataType
- The parameter's data type.isClass
- Flag indicating that the datatype is a legacy OO class.mode
- The call mode.value
- The parameter's value.public java.lang.Object getArgument()
convertTo(Class)
was previously called.argument
.public boolean copyOutput()
SET-PARAMETER
.true
if the value could be copied; false
otherwise.public java.lang.Object convertTo()
value
to be usable as an argument.
Once converted, it will be cached in the argument
variable. The FWD base data type
class is inferred from parameter data type.
argument
.public java.lang.Object convertTo(java.lang.Class<?> cls)
value
to be usable as an argument.
Once converted, it will be cached in the argument
variable.
cls
- The FWD base data type class for the parameter.argument
.private java.lang.Object convertValue(java.lang.String dataType, boolean isClass, CallMode mode, java.lang.Object value)
value
for input/input-output parameters.
For input and input-output the value saved in the value
variable points to the value/reference
used when the parameter was created although that might change in between when the invoke
method is called.
dataType
- The parameter's data type.isClass
- Flag indicating that the datatype is a legacy OO class.mode
- The call mode.value
- The parameter's value as set in ctor.value
reference for input/input-output.private BaseDataType convertTo(BaseDataType val, java.lang.Class<?> type)
This will follow explicit rules to convert from the variable's data-type (passed to
Call.setParameter(com.goldencode.p2j.util.int64, com.goldencode.p2j.util.character, com.goldencode.p2j.util.character, java.lang.Object)
and the value received from the emulated CALL invoke.
At this time, the following data types were not explored and can't be converted unless there variable's and value's data-type match:
val
- The instance configured as OUTPUT/INPUT-OUTPUT with the data type as specified
by Call.setParameter(com.goldencode.p2j.util.int64, com.goldencode.p2j.util.character, com.goldencode.p2j.util.character, java.lang.Object)
, and saved in dataType
.type
- The data type of the actual instance passed to the Call.setParameter(com.goldencode.p2j.util.int64, com.goldencode.p2j.util.character, com.goldencode.p2j.util.character, java.lang.Object)
.