What the j adapter class generator can do, What the j adapter class generator cannot do – FUJITSU J Adapter Class Generator User Manual

Page 11

Advertising
background image

Chapter 1. Outline of J Adapter Class Generator 11

The Java class interface must be converted into the COBOL interface for a COBOL

program to use Java classes. The J adapter class generator generates an adapter

class that converts the Java interface into the COBOL interface.

What the J Adapter Class Generator Can Do

Using adapter classes generated by the J adapter class generator enables the

following types of operation for Java.
To COBOL programs, Java objects seem to be COBOL objects. Therefore, Java

objects can be handled the same way as ordinary COBOL objects.

Accessing a class variable
Access to a public class variable (static field) declared in a Java class is enabled.

COBOL handles it as a factory property.
Invoking a class method
A public class method (static method) declared in a Java class can be invoked.

COBOL handles it as a factory method.
Generating an instance object (invoking a constructor)
Invoking a constructor can create a Java instance object. COBOL handles it as a

factory method that returns an object.
Accessing an instance variable
Access to a public instance variable (non-static field) of a Java instance object is

enabled. COBOL handles it as an object property.
Invoking an instance method
A public instance method (non-static method) of a Java instance object can be

invoked. COBOL handles it as an object method.
Receiving an exception
An exception caused when a class method, constructor, or instance method is

invoked can be trapped to perform error processing. COBOL uses the USE

statement to receive an exception object.

What the J Adapter Class Generator Cannot Do

The J adapter class generator cannot perform the following types of operation:

Inheriting a Java class
A COBOL class inheriting a Java class cannot be defined. Even if a COBOL class

inherits an adapter class, the Java class function cannot be overwritten.
Passing a COBOL object as a parameter
No COBOL object can be passed as a parameter for invoking a method, nor can

a COBOL object be set for a Java field. Only an adapter object produced by

wrapping a Java object can be passed to Java.

Advertising