Understanding the generated Java classes

When you generate Java class wrappers from Workbench or with genjava, a .java file is created for each selected interface in the SMC as well as for each structure, group, and enumeration within the selected interfaces. These generated classes use the xfNetLink Java classes internally to connect with xfServerPlus and pass data.

Procedural classes

The procedural classes (which are derived from the interfaces in the SMC) contain your own user-defined methods as well as a number of utility methods. If you browse a procedural class in Workbench, you’ll see that for each of your methods, the method signature shows the parameter type as specified in the SMC. More information about the parameters is available when you generate Javadoc.

The following public utility methods are included in every procedural class:

connect()
disconnect()
debugInit()
debugStart()
getxfPort()
setxfPort() 
getxfHost()
setxfHost() 
getxfLogfile()
setxfLogfile() 
setxfLogging() 
setxfExceptOnly()
getSynergyWebProxy()
getSSLCertFile()
setSSLCertFile()
getSSLPassword()
setSSLPassword()
getSSLSecCompliance()
setSSLSecCompliance()
getUserString()
setUserString() 
setxfCallTimeout() 
getConnect()
shareConnect() 
getPoolName()
usePool()

These methods are used to connect to and disconnect from xfServerPlus and to set and get properties, such as the host name and port number. There are also methods for setting a call time-out value, for writing a string to the xfServerPlus log, and for specifying client-side logging options. See the Method reference for more information.

Structure classes

The structure classes are built from your structure definitions in the repository. Fields in the repository structure become properties in the structure class, named with the repository field name.

Note

By default, the properties are named with the repository field names. See Passing structures as parameters for details on overriding the default name.

These properties are accessed through “set” and “get” methods. The structure class will include a set and a get method for each property. For example, if the repository field is named “cusname”, the property will be “Cusname”, and there will be two methods to access the value of that property, setCusname() and getCusname().

If there are groups within your repository structures (or fields declared in the repository as “struct” data type), a class will be created for each group, and each field in the group will be a property of that class. There will be a set and get method for each property.

Note

If genjava was run with the -ro option (or the “Generate read-only properties” option was selected in Workbench), structure fields that are marked read-only in the repository will be generated with get methods but no set methods.

In addition to the set and get methods, there are several other methods in the structure classes that are used internally to create a representation of a Synergy structure within the Java language. You don’t need to use these methods, but they have to be public so that they can be called from another class.

For more information about the structure and group classes, see Using structures in xfNetLink Java.

Enumeration classes

Enumeration classes are built from your enumeration definitions in the repository. There will be a .java file, named with the enumeration name, for each repository enumeration that is referenced as a parameter or return value in the SMC, as well as for those enumerations that are referenced as fields within a structure that is passed as a parameter. For more information, see Using enumerations in xfNetLink Java.