CORBA 2.6.1 Programmer's Guide for Java

IDL Compiler Syntax
nsdidl Compiler Syntax
The following line is the command-line syntax for running the IDL compiler. The IDL compiler is invoked with the -language Java option to
generate Java code. You can display help text by using the
-? option.
For example, to invoke the compiler to generate Java bindings, type the following command:
nsdidl -language Java idlfile1[, idlfile2 ]...
Preprocessor Options
-D name
Define name as a macro, with definition '1'. This option is the same when -D name=1 option is used.
-D name=definition
Define name as a macro, with definition as the definition.
-I dir
Insert the specified directory name into the search path for #include files with names not beginning with a slash (/). dir is inserted
ahead of the standard list of include directories. You can specify
dir more than once to add multiple directories to the search path. The
default is the current directory.
-U
Remove any definition of name (overrides any -D in the command line no matter where it appears).
IDL Code-Generation Options
-generate all-includes
Specifies code generation for all included files, even when the IDL file name is not specified on the command line.
-generate no-all-includes
Specifies code generation for IDL files included by top-level #include directives only when the IDL file name was specified on the
command line. This is the default option.
-generate tie
Because Java does not allow multiple implementation inheritance, inheritance-based implementation is not always the best solution.
Delegation can be used to help solve this problem. The
-generate tie option produces a Java tie class (interface_namePOATie.java).
-map2package moduleName package
Explicitly specifies the package name to use as a prefix for moduleName. For example: -map2package CosTransactions org.omg.
Repository IDs generated by the IDL compiler do not reflect the module mapping specified by the -map2package command line option.
This behavior is consistent with the OMG CORBA 2.6 specifications. There are several alternatives to make the repository IDs consistent.
You can add a
#pragma ID directive for each IDL definition, or you can use the #pragma prefix directive. Using the #pragma prefix directive
would require fewer changes to the IDL file. Alternatively, you can edit your IDL files to insert additional module declarations to the IDL
file rather than using -map2package.
-o dir
Place generated files in the specified output directory. The default is the current directory.
-preprocessor
Specify the preprocessor and preprocessor options to be used. The default is cfe -E. The -E is an input argument to cfe directing it
how to operate for the NonStop CORBA environment. Any ANSI C or ANSI C++ preprocessor can be used.
-preprocessed
Specify that the input file has already been preprocessed. This file must end in .idl.i.
-version
Display the IDL compiler version information.
nsdidl Compiler Error Handling
If you make an error while entering a compiler option, the following message appears:
nsdidl: Error: unknown option: -demo,
use: nsdidl [-?][-v][-D name][-D name=definition][-U][-I dir][-language (C++ | J
ava)][-version][-o dir][-generate arg][ -h suffix][-s suffix][-client suffix][-se
rver suffix][-no_][-include level][-typecodes][-IR][-ir][-preprocessor arg][-pre
processed][-map2package module package][-dll define-name][filename]*
1 error
In the command line, you must place any options you are using after the command and before any filenames. If an option appears after a
filename, the following message appears:
nsdidl: Error: compiler options must preceed file names,
use: nsdidl [-?][-v][-D name][-D name=definition][-U][-I dir][-language (C++ | Java)]
[-version][-o dir][-generate arg][ -h suffix][-s suffix][-client suffix][-server
suffix][-no_][-include level][-typecodes][-IR][-ir][-preprocessor arg]
[-preprocessed][-map2package module package][-dll define-name][filename]*
1 error