J2ME Polish
J2ME Polish 2.4 Documentation
Enough Software

Preprocessing

Preprocessing changes the source code before it is compiled. With this mechanism any device optimization can be done easily. An example is the inclusion of the J2ME Polish GUI, which is "weaved" into the application by the build-process without any intervention of the developer. Most preprocessing is triggered by directives, which use either symbols or variables. A symbol is like a boolean value - either it is defined or the symbol is not defined. A variable, however, always contains a value, which can be used or compared during the preprocessing.
Symbols and variables are defined in several files:

  • build.xml: with the "symbols"-attribute of the <build> element and with the <variables> element
  • vendors.xml, groups.xml, devices.xml: symbols are defined by the <features> element, whereas variables are defined by the capabilities. Most capabilities also define symbols.

Thanks to the integrated device database, J2ME Polish supports a lot of useful symbols and variables, with which device optimizations are easier than ever.

Preprocessing directives always start with a "//#" and often have one or more arguments. All directives must not span several rows. J2ME Polish supports all directives (and more) of the antenna preprocessor (antenna.sourceforge.net), by the way. So if you migrate from antenna, you can keep your preprocessing directives.

  • Directives describe the available preprocessing directives in J2ME Polish.
  • Variables & Symbols describe the most common build-in symbols and variables which can be used for the preprocessing.
back to top