Try OpenEdge Now
skip to main content
Java Open Clients
Passing Parameters : ABL data type mappings : INPUT-OUTPUT and OUTPUT parameters : Holder classes
 
Holder classes
For each Java data type that maps to an ABL data type, there is a Holder class. These Holder classes belong to the com.progress.open4gl package and extend the com.progress.open4gl.Holder class, as shown in the following example.

Example: OUTPUT and INPUT-OUTPUT holder class

// Holder Definition
Public class Holder
{    public Holder();
    public Holder(Object value);
    public void setValue(Object value);
    public Object getValue();
    public boolean isNull();
}
This class has two constructors, one that does and one that does not set a value for the parameter. For an OUTPUT parameter, you do not need to set a value in the holder object. For an INPUT-OUTPUT parameter, you typically do need to set a value to pass as input in the holder object. You can also set the value using the setValue() method after the holder is created.
For an INPUT-OUTPUT parameter, you can set an input value to the ABL Unknown value (?) by calling setValue(null) on the holder object. For INPUT-OUTPUT and OUTPUT parameters, the application can find out whether an unknown output value is returned by calling the isNull() method or testing for a null return value from the getValue() method on the holder object.
For each parameter data type extension, the holder class and method names change as follows:
Syntax
Public class DataTypeNameHolder
{    public DataTypeNameHolder();
    public DataTypeNameHolder(DataType value);
    public void setDataTypeNameValue(DataType value);
    public Object getDataTypeNameValue();
}
DataTypeName is an initial upper-case name that closely matches the short intrinsic data type or class name for the value, and DataType is the exact primitive data type or full Java class name (with no changes in letter case).
The following table shows the ABL-to-Java mapping of INPUT-OUTPUT and OUTPUT parameters to specific holder classes.
Table 6. ABL-to-Java data type mapping for INPUT-OUTPUT and OUTPUT parameters
ABL data type
Java proxy data type
CHARACTER
com.progress.open4gl.StringHolder
COM-HANDLE
com.progress.open4gl.COMHandleHolder
DATASET
DATASET-HANDLE1
com.progress.open4gl.ProDataGraphHolder
DATE DATETIME
DATETIME-TZ
com.progress.open4gl.DateHolder
DECIMAL
com.progress.open4gl.BigDecimalHolder
INT64
com.progress.open4gl.LongHolder
INTEGER
com.progress.open4gl.IntHolder
LOGICAL
com.progress.open4gl.BooleanHolder
LONGCHAR
com.progress.open4gl.StringHolder
MEMPTR
com.progress.open4gl.MemptrHolder
RAW
com.progress.open4gl.ByteArrayHolder
RECID
com.progress.open4gl.LongHolder
ROWID
com.progress.open4gl.RowidHolder
TABLE
TABLE-HANDLE
com.progress.open4gl.ProDataGraphHolder
(when mapped as a Java SDO DataGraph)2
TABLE
TABLE-HANDLE
com.progress.open4gl.ResultSetHolder
(when mapped as an SQL ResultSet3, input holds java.sql.ResultSet, output holds com.progress.open4gl.ProResultSet)
WIDGET-HANDLE
com.progress.open4gl.HandleHolder

1 ProDataSet (DATASET and DATASET-HANDLE) and temp-table (TABLE and TABLE-HANDLE) parameters require special handling, including the mapping of temp-table fields. For more information on ProDataSet and temp-table parameters, see Passingtemp-tables and ProDataSets.

2 ProDataSet (DATASET and DATASET-HANDLE) and temp-table (TABLE and TABLE-HANDLE) parameters require special handling, including the mapping of temp-table fields. For more information on ProDataSet and temp-table parameters, see Passingtemp-tables and ProDataSets.

3 ProDataSet (DATASET and DATASET-HANDLE) and temp-table (TABLE and TABLE-HANDLE) parameters require special handling, including the mapping of temp-table fields. For more information on ProDataSet and temp-table parameters, see Passingtemp-tables and ProDataSets.

The following table shows the ABL array-to-Java mapping of INPUT-OUTPUT and OUTPUT array parameters to specific holder classes.
Table 7. ABL with array-to-Java data-type mapping for INPUT-OUTPUT and OUTPUT array parameters
ABL array option
Java proxy data type
CHARACTER
com.progress.open4gl.StringArrayHolder
COM-HANDLE
com.progress.open4gl.COMHandleArrayHolder
DATE DATETIME DATETIME-TZ
com.progress.open4gl.DateArrayHolder
DECIMAL
com.progress.open4gl.BigDecimalArrayHolder
INT64
com.progress.open4gl.LongArrayHolder
INTEGER
com.progress.open4gl.IntArrayHolder
LOGICAL
com.progress.open4gl.BooleanArrayHolder
LONGCHAR
com.progress.open4gl.StringArrayHolder
MEMPTR
com.progress.open4gl.MemptrArrayHolder
RAW
com.progress.open4gl.ByteArrayArrayHolder
RECID
com.progress.open4gl.LongArrayHolder
ROWID
com.progress.open4gl.RowidArrayHolder
WIDGET-HANDLE
com.progress.open4gl.HandleArrayHolder