Generate Java code preview page
This page displays an overview of the Java™ code generation action.
The report displays the directory in which the source code files are generated and the names and locations of all the files that are going to be generated. The report also includes the example commands that can be used to compile the generated Java files and package them into the .jar archive. The name of the .jar archive to be created by these commands is set to match the name of the stage from which the wizard was launched. Make sure that you inspect and modify these example commands before running them in the current environment.
The files are written to the subdirectories of the specified source code directory, as determined by the package specifications in the Java type names. If the package for some of the types is not specified then the .java source code file for that type is generated directly under the specified source code directory. For example, if the source code directory is specified as /projects/javaxom and the Java type name is com.example.import.Test, the wizard creates the directory /projects/javaxom/com/example/import and then generates Test.java file under this directory. If the directory exists, the wizard reuses it.
The code is generated for the Java class or Java interface of the specified type, depending on the value specified for the Output format option in the Java code settings page.
The first code line in every .java file is reserved for the package statement to indicate the package of the Java type for which the code is generated. If the Java type belongs to the default Java package, the package statement is not produced.
The next code segment contains the list of import statements that include Java classes that the code is referencing and but are not in the java.lang package. For example, java.sql.Date, java.sql.Time, java.sql.Timestamp, java.math.BigInteger, and java.math.BigDecimal.
The next code line contains the public class or public interface declaration, depending on the selected output format.
The next code line consists of the opening curly bracket {.
The next code segment consists of the private member declarations, but only if the Class output format was selected.
If the Interface output format is selected, the next code segment contains the method declarations, and for the Class output format, it contains the default method implementations.
Methods declarations are terminated by a semicolon, for example:
public void setFirstName(java.lang.String firstName);
Method implementations consist of the message declaration without the semicolon terminating character, plus the default message bodies, for example:
public void setFirstName(java.lang.String firstName)
{
m_firstName = firstName;
}
- If the method does not return a value, its body consists of the assignment statements that set the member variables to the arguments of the method.
- If the method returns a value, its body consists of a single return statement that returns the member variable associated with the method.
- getColumnName: For the method generated for an output link column of the name ColumnName and whose Description attribute is not set or is set to a value that does not include any CC_JRules(…); entries. One exception is the case when the output link column is of Bit data type, in which case the generated method name is isColumnName.
- method_name: For the method generated for an output link column whose description attribute includes the entry CC_JRules(method_name);
- setColumnName: For the method generated for an input link column of the name ColumnName and whose Description attribute is not set or is set to a value that does not include any CC_JRules(…); entries.
- method_name: For the method generated for a set of n input link columns where each column corresponds to one of the n arguments of the method and where the column Description attributes are set and include the following entries: CC_JRules(method_name,1); CC_JRules(method_name,2); … CC_JRules(method_name,n);.
The last code line consists of the closing curly bracket }.