Explanation
Public classes and interface are mapped to COBOL classes. The inheritance relationships of adapter classes are the same as those of the corresponding Java classes. Note that the following Java class inherits no other classes or interfaces but the adapter classes generated inherit JF-JAVA-BASE.
java.lang.Object class
Similarly, the following interface inherits no other classes or interfaces but the adapter classes generated inherit java.lang.Object.
Interface that inherits no other interface
Expansion format
CLASS-ID. internal-class-name-1 AS "external-class-name" INHERITS internal-class-name-2. ... FACTORY. ... <<Factory method corresponding to a constructor>> <<Property method corresponding to a class variable>> <<Factory method corresponding to a class method>> END FACTORY. OBJECT. ... <<Property method corresponding to an instance variable>> <<Object method corresponding to an instance method>> END OBJECT. END CLASS internal-class-name-1.
Generation rules
Internal class names 1 and 2 are internally used by the J adapter class generator and are not viewed from the class user.
The external class name is used to identify the class. The class user can identify the class with the external class name.
An external class name is generated according to the following rules:
[PackageName-[PackageName-...]] ClassName/InterfaceName
The following three methods are generated in the FACTORY definition:
Factory method corresponding to a constructor
Property method corresponding to a class variable
Factory method corresponding to a class method
The following two methods are generated in the OBJECT definition:
Property method corresponding to an instance variable
Object method corresponding to an instance method
Generation example
The adapter class of the java.util.Date class is generated as shown below:
CLASS-ID. J-DATE AS "java-util-Date" INHERITS J-OBJECT. [1] ... REPOSITORY. CLASS J-OBJECT AS "java-lang-Object". [2] ... END CLASS J-DATE.
The name of the adapter class of the java.util.Date class is java-util-Date.
The external name of J-OBJECT in the INHERIT clause is java-lang-Object. That is, java-util-Date inherits java-lang-Object.
Note
NetCOBOL does not distinguish between uppercase and lowercase letters of a class name. Therefore, class names whose external class names are different only in uppercase and lowercase letters cannot be used concurrently.
Supplement
When the adapter class of java.lang.String is generated, the public method defined in the java.lang.String class is generated. In addition, a method for referencing or setting character string data is generated. (see "5.6 java-lang-String class".)