![]() |
Spec-Zone .ru
спецификации, руководства, описания, API
|
This release of the JavaTM 2
Platform Standard Edition 5.0, includes idlj, a compiler
that reads an Object Management Group (OMG) Interface Definition
Language (IDL) file and translates it, or maps it, to a Java
interface. Depending on the command-line options used, the
idlj compiler creates stub, skeleton, helper, holder, and
other files as necessary. These .java files are generated
from the IDL file according to the mapping specified in the OMG
document (pdf format)
Some topics from the OMG IDL to Java Language Mapping specification that are not easily summarized are:
CORBA objects are defined in OMG IDL (Object Management Group
Interface Definition Language). The syntax and semantics of OMG IDL
are defined in Chapter 3 of the
This overview shows the correspondence between OMG IDL types and Java types. Note that OMG IDL, as its name implies, defines interfaces. Like Java interfaces, IDL interfaces contain no implementations for their operations (methods in Java). In other words, IDL interfaces define only the signature for an operation (the name of the operation, the data type of its return value, the data types of the parameters that it takes, and any exceptions that it raises). The implementations for these operations need to be supplied in Java classes written by a Java programmer.
The following table lists the main constructs of IDL and the corresponding constructs in Java.
IDL Type |
Java Type |
---|---|
module |
package |
boolean |
boolean |
char, wchar |
char |
octet |
byte |
string, wstring |
java.lang.String |
short, unsigned short |
short |
long, unsigned long |
int |
long long, unsigned long long |
long |
float |
float |
double |
double |
fixed |
java.math.BigDecimal |
enum, struct, union |
class |
sequence, array |
array |
interface (non-abstract) |
signature interface and an operations interface, helper class, holder class |
interface (abstract) |
signature interface, helper class, holder class |
constant (not within an interface) |
public interface |
constant (within an interface) |
fields in the Java signature interface for non-abstract, or the sole Java interface for abstract |
exception |
class |
Any |
org.omg.CORBA.Any |
type declarations nested within interfaces |
"scoped" package |
typedef |
helper classes |
pseudo objects |
pseudo interface |
readonly attribute |
accessor method |
readwrite attribute |
accessor and modifer methods |
operation |
method |
Java Technology |
Copyright © 1993, 2010, Oracle and/or its affiliates. All rights reserved. |