Argument and Return Types
When calling Java methods from Excel Jinx automatically converts from the Excel cell type to the Java type expected by the method and from the type returned by the method to an Excel type.
Jinx supports a number of standard types, including arrays. It is also possible to add your own custom types. Types that are not mapped and don’t have a type converter can still be passed between functions as cached objects.
Java types map to Excel types as follows:
Java Type | Excel Type |
boolean | boolean |
byte | number |
char | number |
short | number |
int | number |
long | number |
float | number |
double | number |
java.lang.String | string |
java.math.BigDecimal | number |
java.util.Date | datetime1 |
java.time.LocalDate | datetime1 |
java.time.LocalTime | datetime1 |
java.time.LocalDateTime | datetime1 |
java.sql.Date | datetime1 |
java.sql.Time | datetime1 |
java.sql.Timestamp | datetime1 |
java.lang.Exception | error |
ExcelReference | cell reference |
Methods that take an Object as an argument will receive an Object of the following types:
Excel Type | Object Type |
boolean | java.lang.Boolean |
number | java.lang.Double |
string | java.lang.String |
error | java.lang.Exception |
If a method returns an type other than any of the types mentioned above, the returned instance is stored in a managed object cache and a handle to that instance is returned. If another function expects an argument of that type then it can be passed a handle and the object will be retrieved from the cache before invoking the Java method. See Cached Objects for more details.