Environment

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.

Custom environment variables

Lets you view and/or modify the custom environment variables.

Figure 2.22. Custom Environment settings page

Custom Environment settings page

Use the Add... and Remove buttons to add or remove items to and from the list.

Figure 2.23. Add Custom Environment Variable

Add Custom Environment Variable

Select a variable and press the Change... button if you want to adjust an existing environment variable.

Figure 2.24. Change Custom Environment Variable

Change Custom Environment Variable

Local Overrides

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 SystemJalopy .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 VistaC:\Users\John Doo\AppData\Roaming\.jalopy\.user.properties
Windows XPC:\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

Example 2.5. Local Overrides File

author=John Doo
division=IT_DEV_AR

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.