Lets you specify, view and adjust environment variables.
Environment variables are simple key/value pairs and can be used in
header,
footer and Javadoc
templates to form expressions that will be resolved during printing. Embedded
strings of the form $variable$ are replaced with their
corresponding value. This process is called variable
interpolation.
Valid keys take the form [a-zA-Z_][a-zA-Z0-9_.-]*
and are case-sensitive. Values can be freely chosen.
Example 2.3. Header template with environment variables expressions
//-------------------------------------------------------------- // file : $file.name$ // project: $project$ // // create: date: $date$ // by: $author$ // //-------------------------------------------------------------- // copyright: BSJT Software License (see class documentation) //--------------------------------------------------------------
Example 2.4. Sample environment variables
author = John Doo project.description = Nukes: The OpenSource CMS
Jalopy lets you define custom variables, but also provides access to the Java environment variables as well as some Jalopy-specific variables that are generally useful for common source formatting needs.
Lets you view and/or modify the custom environment variables.
Use the and buttons to add or remove items to and from the list.
Select a variable and press the button if you want to adjust an existing environment variable.
Custom user variables are stored as part of your code convention and are
therefore shared across a whole team. If you need to define user-specific
information, e.g. to automatically add the name of the developer who creates a
class, this is possible via the local overrides file
“.user.properties”.
When found in the Jalopy settings directory, the specified variables will override any other custom or system variables. The overrides file uses the common java.util.Properties format.
Table 2.3. Typical .overrides locations for user “John Doo”
| Operating System | Jalopy .overrides Location |
|---|---|
| Linux | /home/John Doo/.jalopy/.user.properties |
| Mac OS X | /Users/John Doo/.jalopy/.user.properties |
| Solaris | /export/home/John Doo/.jalopy/.user.properties |
| Windows Vista | C:\Users\John Doo\AppData\Roaming\.jalopy\.user.properties |
| Windows XP | C:\Documents and Settings\John Doo\.jalopy\.user.properties |
Please consult your operating system documentation if your system uses different paths for the user directories. Detailed information about the Jalopy settings directory can be found in Chapter 2, Configuration.
Since 1.6
The above example would define/override the variables “author” and “division”. Please note that the environment may be overwritten manually using the Console and Ant Plug-ins as well. Please refer to the corresponding Plug-in documentation.