Telosys variables
Telosys provides a set of predefined variables which can be used in all template files.
Standard variables
Standard variables have predefined names, their values are either set by Telosys or can be defined in the project configuration.
Special characters
These variables are used to simplify the writing of templates when certain special characters are required and are difficult to mix with Velocity syntax.
These variables should be considered as "constants" and used as such.
Variable name | Variable value |
$DOLLAR (dollar character) | $ |
$SHARP (sharp character) | # |
$AMP (ampersand character) | & |
$QUOT (double quotation mark) | " |
$LT (less-than sign) | < |
$GT (greater-than sign) | > |
$LBRACE (left brace) | { |
$RBRACE (right brace) | } |
$NEWLINE (new line character) | \n |
$TAB (tabulation character) | \t |
Project configuration
These variables are specific for each project. They can be defined in the project configuration file ( "telosys-tools.cfg" )
All the project configuration variables are usable in both templates files (".vm" files) and bundle configuration file ("templates.cfg").
Directories
Variable name | Configuration value |
$SRC | Directory where to generate sources e.g. "src/main/java", "src" |
$RES | Directory where to generate resources e.g. "src/main/resources", "conf" |
$WEB | Directory where to generate web files e.g. "src/main/webapp", "www" |
$TEST_SRC | Directory where to generate test sources e.g. "src/test/java" |
$TEST_RES | Directory where to generate test resources e.g. "src/test/resources" |
$DOC | Directory where to generate documentation files e.g "doc" |
$TMP | Directory where to generate temporary files e.g. "tmp", "temp" |
Packages
Variables usable for target languages having a notion of "packages" or "modules" or "namespaces" (Java, Golang, C#, etc)
Variable name | Configuration value |
$ROOT_PKG | The root package containing all other packages |
$ENTITY_PKG | The package containing the entities classes or structures |
Specific variables
If you need more variables for your project you can define them in the project configuration file "telosys-tools.cfg".
Once defined, these specific variables are usable exactly like standard variables.
You can use them in both templates files (".vm" files) and bundle configuration file ("templates.cfg").
Last updated