Expansion format, Generation rules, Generation example – FUJITSU J Adapter Class Generator User Manual

Page 53

Advertising
background image

Chapter 5. Adapter Class Reference 53

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
1. Internal class names 1 and 2 are internally used by the J adapter class generator

and are not viewed from the class user.

2. The external class name is used to identify the class. The class user can identify

the class with the external class name.

3. An external class name is generated according to the following rules:

[PackageName-[PackageName-...]] ClassName/InterfaceName

-

Period "." used in the class name or interface name fully qualified with a

package name is replaced with hyphen "-".

-

A name exceeding 160 characters is truncated after the 160th character.

4. 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

5. 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.

1. The name of the adapter class of the java.util.Date class is java-util-Date.
2. The external name of J-OBJECT in the INHERIT clause is java-lang-Object. That

is, java-util-Date inherits java-lang-Object.

Advertising