Example – FUJITSU J Adapter Class Generator User Manual

Page 71

Advertising
background image

Chapter 5. Adapter Class Reference 71

the J adapter class generator. For instance, the java.io.ObjectInputStream class

inherits the java.io.ObjectInput interface and java.io.InputStream class (see the

figure below).

Figure 5.2

Relationships among java.io.ObjectInput interface, java.io.InputStream

class, and java.io.ObjectInputStream class
For the adapter class corresponding to these interface and classes, methods of the

same name must be generated for the read methods having the same parameters.
The J adapter class generator uses the generation name management file to manage

the correspondence of method names across classes or interfaces. It then assigns

numbers to methods with the same name according to the following rules:
1. The J adapter class generator searches the generation name management file

for a method having the same name and parameter.

2. If a matching method is found, it uses the corresponding COBOL method name.
3. If no matching method is found, it generates a new COBOL method and adds it

to the generation name management file.

4. A COBOL method name is generated according to the following rule:

-

The COBOL method name that is first added is the same as the Java method

name.

-

The second and subsequent COBOL method names are assigned number in

ascending order from 01.

Example
The object methods corresponding to the read methods of the java.io.ObjectInput

interface, java.io.InputStream class, and java.io.ObjectInputStream class are

assigned names as shown below:

Java method

COBOL method

Advertising