You will generally not be required to manipulated Java class definitions except in a few cases where it is impossible for the Java repository to calculate the correct information. These situations and the format of the definitions detailed below.
The following is an example of a Java type definition as the Smalltalk repository would store it in an application method.
1 sun_rmi_registry_RegistryImpl 2 ^#((#class 'sun.rmi.registry.RegistryImpl' 'java.rmi.server.RemoteServer' #SstRmiRegistry 4666870661827494597 4905912898345647071 ('java.rmi.registry.Registry' 'java.rmi.Remote')) 3 (('bindings' 'Ljava.util.Hashtable;' #bindings #bindings:)) 4 (#bind:to: 'bind(Ljava.lang.String;Ljava.rmi.Remote;)V' ('java.rmi.RemoteException' ...) 7583982177005850366) 5 ...)
The example illustrates the following:
The Java repository is able to output all information but that in the <Smalltalk*> fields, which include the implementation class, method selectors, and field accessors. By default the <Smalltalk*> elements of the definition are given as ##nil. In the case of the implementation class and method selector, these values must be replaced by you. This is done by editing the relevant files or methods.
If a field accessor entry is ##nil, the default accessors derived from the field name (for example, name and name:) are used. You can redefine these to be the selector of your choice.
Note that merging a new file from the Java repository into an existing repository or application will preserve the Smalltalk information previously specified.
The method entries are only required if the class is not serializable (that is, remote). Serializable objects are copied and, once instantiated in Smalltalk, are normal Smalltalk objects.
The builder can also take minimal Java class and interface descriptions and generate both the SST specifications described above and Java files containing the corresponding Java source. This is done using the generate* builder protocols. For example:
SstRmiTypeBuilder new generateClassesAndJavaFor: 'java.class.name' interfaces: #('interface.1' 'interface.2' ...) methods: #( ('method1(Ljava.lang.String;J)Z'('java.exception.1' 'java.exception.2' ...)) ...)
Note that there are several other related builder API methods. In addition, the output of the builder is controlled by setting the application, buildDirectoryStructure, stubVersion, and directory attributes. Detailed explanations are provided in the setter method comments.