public interface ICallTarget2
ICallTarget
,
ICancelTarget
,
IDatatype
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
call(IProgramEnvironment programEnvironment,
boolean[] byReference,
java.lang.Object[] params)
This is the method called by the CALL verb for a program implementing
ICallTarget2.
|
java.lang.Object call(IProgramEnvironment programEnvironment, boolean[] byReference, java.lang.Object[] params) throws java.lang.Throwable
If there are no parameters, byReference and params may be null.
If there are parameters, byReference.length and params.length will be the number of parameters.
The Objects in params generally implement IDatatype. The IDatatype interface allows conversion to and from a variety of common Java datatypes.
If the Cobol program passes Object declared as OBJECT [REFERENCE], then the object itself will be passed directly. If the ICallTarget2 is intended only for traditional data, just cast the data to IDatatype.
Throwing an Exception is allowed. This will invoke the ON EXCEPTION clause of the CALL. If there is no ON EXCEPTION clause, then a message dialog will appear with the information.
The Cobol program must be ready to handle the exception if user input is to be suppressed from an exception.
Only use fromType methods on a param if the byReference is true.
programEnvironment
- contains an implementor of IProgramEnvironment,
representing the current program environment.byReference
- possibly null, a boolean for each parameter,
true if by reference, false if by content
(by value is generally by content)params
- possibly null, an Object for each parameter,
implementing IDatatype for Cobol-oriented data,
though any object including null may be passedat-throws any Throwable such as CobolException should an unrecoverable failure occur
(note: javadoc 1.8_0.181 fails to find at-throws; fixed in javadoc 1.8_0.191)
java.lang.Throwable