Appendix B: Data Type Mapping for xfNetLink Java
This appendix includes information on data type mapping for parameters, return values, and fields in repository structures passed as parameters.
Parameter and return value type mapping
The tables in this section list the supported data types and show how parameter and return value data types are mapped from Synergy to Java when you generate Java class wrappers.
For primitive Java data types, return values and “in” parameters are mapped as listed in the table, but “out” and “in/out” parameters use the corresponding holder classes. For example, an implied-decimal data type that is an “in” parameter is mapped to a double, while an implied-decimal data type that is an “out” parameter is mapped to a DoubleHolder. |
For decimal, implied-decimal, and integer data types, you can choose to coerce the data to a non-default type on the Java side by selecting the desired data type in the Coerced type field when defining methods in the MDU. (See the Coerced type field.) If you are using attributes, see the description of cType for instructions on specifying non-default type mapping. When coercing data to a non-default data type, you should take care to select a type that is suitable for the size of the data that will be placed in the parameter or return value. The data type in the “Default Java data type” column will be used when “Default” is specified for the coerced type in the MDU.
xfNetLink Java Parameter and Return Value Mapping |
|||
---|---|---|---|
Data type in SMC |
Size in SMC |
Default Java data type |
Non-default Java types available |
^VALa |
N/A |
int |
N/A |
Alpha |
≤ 65,535 |
String (“in” parameters and return values) StringBuffer (“out” and “in/out” parameters) |
N/A |
Binary (handle)b |
N/A |
generic ArrayList |
N/A |
Decimal (d) |
1, 2 |
byte |
byte, short, int, long, Boolean, DateTime (Calendar), decimal (BigDecimal) |
3, 4 |
short |
||
5 – 9 |
int |
||
10 – 18 |
long |
||
19 – 28 |
BigDecimal (“in” parameters and return values) FixedHolder (“out” and “in/out” parameters) |
||
Enumeration |
N/A |
enum type |
N/A |
Handleb |
N/A |
String (“in” parameters and return values) StringBuffer (“out” and “in/out” parameters) |
N/A |
Implied-decimal (d.) |
≤ 16.* |
double |
decimal (BigDecimal), double, float |
≥ 17.* |
BigDecimal (“in” parameters and return values FixedHolder (“out” and “in/out” parameters) |
||
Integer |
1 |
byte |
byte, short, int, long, Boolean |
2 |
short |
||
4 |
int |
||
8 |
long |
||
System.String |
N/A |
String (“in” parameters and return values) StringBuffer (“out” and “in/out” parameters) |
N/A |
Field type mapping
The table below shows how data types within repository structures are mapped to Java when you generate class wrappers. The structure itself becomes a class; this table shows what the data types for the properties of that class will be.
The first column indicates the value in the Type field of the Field Definition window in Repository. The second column indicates the value in the Class field and, where necessary, the value in the User data field in that same window.
Some data types can be coerced to a non-default type in Java. To use a non-default type, select the desired data type in the Coerced type field of the Field Definition window in Repository. When coercing data, take care to select a non-default type that is suitable for the size of the data that will be placed in the property. The data type in the “Default Java data type” column is used when “Default” is specified for the coerced type in Repository.
xfNetLink Java Field Type Mapping |
|||
---|---|---|---|
Field data type in Repository |
Format |
Default Java data type |
Non-default Java data types available |
Alpha |
N/A |
String (“in” parameters) StringBuffer (“out” and “in/out” parameters) |
N/A |
AutoSeq |
N/A |
long |
N/A |
AutoTime |
N/A |
Calendar |
N/A |
Binary |
N/A |
byte array |
N/A |
Boolean |
N/A |
Boolean |
N/A |
Datea |
YYMMDD |
Calendar |
N/A |
YYPP |
String |
||
Decimal |
N/A |
Mapping is the same as for decimal parameters; see the table above. |
byte, short, int, long, Boolean, decimal (BigDecimal) |
Decimal |
N/A |
Mapping is the same as for implied-decimal parameters; see the table above. |
double, decimal (BigDecimal) |
Enum |
N/A |
Enum type |
N/A |
Integer |
N/A |
Mapping is the same as for parameters; see the table above. |
byte, short, int, long, Boolean |
Struct |
N/A |
N/A. Becomes a class (treated the same as a group). |
N/A |
Time |
HHMM |
Calendar |
N/A |
User |
Date with ^CLASS^= YYYYMMDDHHMISS or |
Calendara |
N/A |
Date with any other value in the User data field |
String |
||
Alpha |
|||
Binary |
|||
Numeric |
a. When a Synergy routine sends a zero date to xfNetLink Java, a Date or Calendar object with a default date of 01/01/0001 is created. Your client application needs to test for this date to know that a zero date was sent. When xfNetLink Java sends a date of 01/01/0001 to a Synergy routine, a zero date is created.