Creating adapter classes, Investigating the java class, Generating adapter class source – FUJITSU J Adapter Class Generator User Manual

Page 18

Advertising
background image

18 Chapter 3. Developing Programs

Creating Adapter Classes

This section explains how to generate an adapter class from a Java class.

Investigating the Java Class

First investigate the specifications of the Java class and interface to be used (class

name, package name, usage, and so on) to check whether the J adapter class

generator can handle the class and interface. See "

What the J Adapter Class

Generator Can Do

" and "

What the J Adapter Class Generator Cannot Do

" for

information on which classes and interfaces can be used.

Generating Adapter Class Source

If the target Java class and interface can be used, generate adapter class source.

Use the java2cob command to generate adapter classes. The java2cob command

reads the class file (extension .class) of the Java class/interface and generates the

corresponding adapter class source.
The java2cob command generates adapter classes of not only the class specified by

the option but also every other class/interface required to use the class.
An example of generating adapter class source from the java.util.Date class is shown

below.

Figure 3.1

Note: The class file referenced by the class/interface may not always be available,

depending on the execution environment. For information on how to generate

Advertising