G.2. Identifiers
Identifiers can
G.2.1. Mapping Identifiers to JavaAn IDL-to-Java compiler attempts to map all IDL identifiers unchanged into equivalent Java identifiers.
An exception is the case in which a mapped identifier conflicts with an identifier created automatically by the IDL compiler. IDL interfaces, for example, when they are mapped to Java, have two additional Java interfaces created for them, named using the name of the original interface with
Helper
and
Holder
appended (see Chapter 14 for details on the purpose of these generated interfaces). So an interface named
List
will be mapped into a Java interface named
List
, but will also cause the creation of a Java interface named
ListHelper
and another named
ListHolder
. If there is another identifier in the IDL file that you've named
ListHelper
or
ListHolder
, its mapped Java identifier will have an underscore prepended to it (e.g.,
_ListHelper
,
_ListHolder
), to avoid a conflict with the generated interface
The other exception to the general rule of directly mapping IDL identifiers to Java identifiers is with a mapping that conflicts with Java keywords. In these cases, the mapped Java identifier has an underscore prepended to it. If, for example, you declared a constant named package (not a reserved keyword in IDL), it is mapped into a Java variable named _package . |
G.3. CommentsComments in IDL follow the format of C, C++, and Java comments . A block comment starts with the character sequence /* and ends with the character sequence */ . A line comment begins with the character sequence // , and ends at the end of the line on which it begins. G.3.1. Mapping Comments to JavaThere are no rules for mapping IDL comments to Java. Many IDL-to-Java compilers will simply drop comments from IDL files during the conversion to Java, since in many cases, the comments refer to the IDL code and may not be totally relevant in the generated Java code. |