Inserting package prefixes

This option has the following form:

-pkgPrefix type package

It ensures that wherever type is encountered, type resides within package in all of the generated files.

For example, let us suppose that a company called ABC has constructed the following Interface Definition Language (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 must reside within a package named com.company name? Then, the Widgets package does not conform. To follow the convention, it must be com.abc.Widgets. To place this package prefix onto the Widgets module, implement the following:

idlj -pkgPrefix Widgets com.abc Widgets.idl

Be aware that if you have an IDL file that includes Widgets.idl, the -pkgPrefix flag must appear on that command as well. If it does not, then your IDL file will look 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=prefix

The line for the previous example would be:

PkgPrefix.Widgets=com.abc

Related reference
IDL-to-Java compiler
Specifying alternative locations for include files



Searchable topic ID:   rcor_idl2j4
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_idl2j4.html

Library | Support | Terms of Use | Feedback