Progress
Open Client
Developer’s Guide
INPUT-OUTPUT and OUTPUT Parameters
Java supports no direct mechanism to return a value from a method using parameters. However, any Java application can provide object parameters (holder objects) to contain the value that you want to return.
Holder Classes
For each of the Java data types that map to a Progress data type, there is a
Holder
class. TheseHolder
classes belong to thecom.progress.open4gl
package and extend thecom.progress.open4gl.Holder
class shown in Example 5–1.
Example 5–1: Output Holder ClassFor an INPUT-OUTPUT parameter, you can set an input value to the 4GL unknown value (?) by calling
setValue(null)
on the holder object. For OUTPUT parameters, the application can find out whether an unknown output value is returned by calling theisNull()
method or by testing for anull
return value from thegetValue()
method on the holder object.Table 5–2 shows the 4GL-to-Java mapping of input-output and output parameters to specific
Holder
classes.
Holder Class Definitions
The Holder class definitions for each data type follow the form shown in Example 5–2.
Example 5–2: Holder Class Definitions
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |