11 |
11 |
** 003 ME 20230829 Added default ctor and set properties according to parameter signature.
|
12 |
12 |
** ME 20230904 Override toString to use the string representation in method signature.
|
13 |
13 |
** ME 20230918 Cache string representation, fix parameter mode enum mapping.
|
|
14 |
** 004 CA 20231106 Properly report DATASET/TABLE/-HANDLE parameters.
|
14 |
15 |
*/
|
15 |
16 |
|
16 |
17 |
/*
|
... | ... | |
74 |
75 |
import static com.goldencode.p2j.report.ReportConstants.RT_LVL_FULL;
|
75 |
76 |
import static com.goldencode.p2j.util.InternalEntry.Type;
|
76 |
77 |
|
|
78 |
import java.lang.reflect.*;
|
|
79 |
|
77 |
80 |
import com.goldencode.p2j.oo.lang.LegacyEnum;
|
|
81 |
import com.goldencode.p2j.persist.*;
|
78 |
82 |
|
79 |
83 |
/**
|
80 |
84 |
* Business logic (converted to Java from the 4GL source code
|
... | ... | |
99 |
103 |
|
100 |
104 |
private String txtSig;
|
101 |
105 |
|
102 |
|
public Parameter (int position, LegacyParameter legacyParam) {
|
|
106 |
public Parameter (int position, LegacyParameter legacyParam, Method mthd) {
|
103 |
107 |
this.position.assign(position + 1);
|
104 |
108 |
this.name.assign(getName(legacyParam));
|
105 |
109 |
this.mode.assign(getMode(legacyParam));
|
106 |
|
this.dataType.assign(DataType.getEnum(new character(legacyParam.type())));
|
|
110 |
java.lang.reflect.Parameter mthdParam = mthd.getParameters()[position];
|
|
111 |
Class<?> mthdParamType = mthdParam.getType();
|
|
112 |
if (DataSetParameter.class.isAssignableFrom(mthdParamType))
|
|
113 |
{
|
|
114 |
if (InputDataSetHandle.class == mthdParamType ||
|
|
115 |
OutputDataSetHandle.class == mthdParamType ||
|
|
116 |
InputOutputDataSetHandle.class == mthdParamType)
|
|
117 |
{
|
|
118 |
this.dataType.assign(DataType.dataSetHandle);
|
|
119 |
}
|
|
120 |
else
|
|
121 |
{
|
|
122 |
this.dataType.assign(DataType.dataSet);
|
|
123 |
}
|
|
124 |
}
|
|
125 |
else if (TableParameter.class.isAssignableFrom(mthdParamType))
|
|
126 |
{
|
|
127 |
if (InputTableHandle.class == mthdParamType ||
|
|
128 |
OutputTableHandle.class == mthdParamType ||
|
|
129 |
InputTableHandle.class == mthdParamType)
|
|
130 |
{
|
|
131 |
this.dataType.assign(DataType.tableHandle);
|
|
132 |
}
|
|
133 |
else
|
|
134 |
{
|
|
135 |
this.dataType.assign(DataType.table);
|
|
136 |
}
|
|
137 |
}
|
|
138 |
else
|
|
139 |
{
|
|
140 |
this.dataType.assign(DataType.getEnum(new character(legacyParam.type())));
|
|
141 |
}
|
|
142 |
|
107 |
143 |
this.dataTypeName.assign(legacyParam.qualified() == null || legacyParam.qualified().isEmpty() ? null : legacyParam.qualified());
|
108 |
144 |
// extends is unknown if size not set, 0 if not an array
|
109 |
145 |
if (legacyParam.extent() != -1)
|