![]() |
This option has the following form:
-pkgPrefix type packageIt ensures that wherever type is encountered it resides within package in all generated files.
For example, let us suppose that a company called ABC has constructed the following IDL file:
Widgets.idl module Widgets { interface W1 {...}; interface W2 {...}; };Running this file through the IDL-to-Java compiler places the Java bindings for W1 and W2 within the package Widgets. But what if there is an industry convention that states that a company's packages should reside within a package named com.company name? Then the Widgets package does not conform. To follow the convention, it should be com.abc.Widgets. To place this package prefix onto the Widgets module, you implement the following:
idlj -pkgPrefix Widgets com.abc Widgets.idlYou should be aware that, if you have an IDL file which includes Widgets.idl, the -pkgPrefix flag must appear on that command as well. If it does not, then your IDL file will be looking for a Widgets package rather than a com.abc.Widgets package.
If you have a number of these packages that require prefixes, it might be easier to place them into the idl.config file as described in Specifying alternative locations for include files. Each package prefix line should be of the form:
PkgPrefix.type=prefixSo the line for the above example would be:
PkgPrefix.Widgets=com.abc