Difference between revisions of "Documentation/DevGuide/ProUNO/Java/Mapping of UNOIDL"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (1 revision(s))
m (Robot: Changing Category:Professional UNO)
Line 59: Line 59:
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Professional UNO]]
+
 
 +
[[Category:Documentation/Developers Guide/Professional UNO]]

Revision as of 15:14, 8 May 2008




Mapping of UNOIDL Typedefs

UNOIDL typedefs are not visible in the Java language binding. Each occurrence of a typedef is replaced with the aliased type when mapping from UNOIDL to Java.

Mapping of Individual UNOIDL Constants

An individual UNOIDL constant

 module example { 
     const long USERFLAG = 1;
 };

is mapped to a public Java interface with the same name:

 package example;
 
 public interface USERFLAG {
     int value = 1;
 }

Note that the use of individual constants is deprecated.

Mapping of UNOIDL Constant Groups

A UNOIDL constant group

 module example { 
     constants User {
         const long FLAG1 = 1;
         const long FLAG2 = 2;
         const long FLAG3 = 3;
     };
 };

is mapped to a public Java interface with the same name:

 package example;
 
 public interface User {
     int FLAG1 = 1;
     int FLAG2 = 2;
     int FLAG3 = 3;
 }

Each constant defined in the group is mapped to a field of the interface with the same name and corresponding type and value.

Mapping of UNOIDL Modules

A UNOIDL module is mapped to a Java package with the same name. This follows from the fact that each named UNO and UNOIDL entity is mapped to a Java class with the same name. (UNOIDL uses “::” to separate the individual identifiers within a name, as in “com::sun::star::uno”, whereas UNO itself and Java both use “.”, as in “com.sun.star.uno”; therefore, the name of a UNOIDL entity has to be converted in the obvious way before it can be used as a name in Java.) UNO and UNOIDL entities not enclosed in any module (that is, whose names do not contain any “.” or “::”, respectively), are mapped to Java classes in an unnamed package.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools