Java API Class Worksheet
Introduction
A Java API Class Worksheet describes how AlchemyJ Compiler should generate a class. It defines the name of the class, the package it is in, the functions it provides and the worksheets it uses.
It contains the following sections:
Basic Settings
Define the basic information for a Java Class.
Item | Description |
---|---|
Sub-package name | Input the sub-package name that this class should be in. The actual package this class will be in is [package name].[Sub Package Name]. The Class that should be put into the same package should have the same sub-package name here. |
Class Name | Define the name of this Java Class. It must begin with an alphabet and contain no space or dot. |
Functions
It defines a list of functions this class provides and their properties.
Item | Description | Remark |
---|---|---|
Function Point | The name of this Function Point used in AlchemyJ Studio. It can be a name with spaces. | The function point list will be shown in AlchemyJ > Preview Function Point. |
Method Name | The Name of the function in generated Java code. This is the method name that other Java developers will use when calling this function in their project. | It must begin with an alphabet and contain no space or dot. If it is blank, the Function Point would be used as the method name when compiling. |
Return Class | The type of the return value. | The value can be: Big Number: the length of return number could be more than 15. Big String: the length of return string could be more than the Excel maximum number of character (32727) limitation. Boolean: TRUE or FALSE Date: Date value Double: A whole number between 4.9406564584124654 x 10^-324. to 1.7976931348623157 x 10^308 Integer: A whole number between -2,147,483,648 and 2,147,483,647. String: Text value Object: Object |
Return Data Address | The cell address where AlchemyJ should refer to for the output of this function. | It should include the sheet name. For example, Sheet1!A2. If the Return Class is Object, this should be the address of a Data Relationship Schema. It is recommended to use ajAddress to get the address value instead of typing in an address manually. |
Data Source ID | It defines data source ID when DB connection is required. | The data source ID should exist in ##ExternalResources Worksheet. Multiple data source ID shall be separated by a comma. |
Kafka Connection ID | The Kafka connection ID when Kafka service is required. | The Kafka connection ID should exist in ##ExternalResources Worksheet. Multiple connection ID shall be separated by a comma. |
Function input parameters
Input parameters for the defined functions if any.
Item | Description | Remark |
---|---|---|
Function Point | The function point this input parameter refers to. | The value must exist in the Function Point column of Functions table. |
Name | The Name of this parameter. | It must begin with an alphabet and contain no space or dot. |
Class | The value this parameter may hold. | The value can be: Big Number: the length of return number could be more than 15 digits. Big String: the length of return string could be more than the Excel maximum number of character (32727) limitation. Boolean: TRUE or FALSE Date: Date value Double: A whole number between 4.9406564584124654 x 10^-324. to 1.7976931348623157 x 10^308 Integer: A whole number between -2,147,483,648 and 2,147,483,647. String: Text value Object: Object |
Data Address | The cell address where this parameter value should be written to. | It should include the sheet name. For example, Sheet1!A2. If the Class is object, the Data Address should be the address of a Data Relationship Schema. It is recommended to use ajAddress to get the address value instead of typing in an address manually. |
Example Value | The example value of the parameter. | It will be used in Testing Tool as the default value. |
Related Worksheets
The Related Worksheet section defines the function point and worksheet relationship. There is no need to include system worksheets and definition worksheets, such as : %%AppConfig, %%SysRuntime, ##JavaApiPackage and so on. The worksheets of the component and snippet should be included, such as the Data Relationship Schema. AlchemyJ provides an utilities in AlchemyJ ribbon -> More Tools -> Configure Function Point Related Worksheets provides a user interface to setup this table.
Item | Description |
---|---|
Function Point | The name of the function point. If the function point is blank, then all function points in this class will use the defined worksheet names. It is recommend to define the necessary worksheet for each function point. |
Worksheet Name | Related Worksheet name of the function point. |