General Settings |
| Setting | Type | Description |
|---|
main.JostracaVersion [ top ] | |
This setting indicates the version of Jostraca expected by the
template. This setting is required in the conf directive of each template. Jostraca uses
the version number specified here to enable backwards compatibility
between templates.
The minimal conf directive in any template is thus:
<% @conf
main.JostracaVersion = 0.4
%>
|
main.TemplateScript [ top ] | |
Jostraca templates can be scripted in many languages. This setting
specifies the scripting language used in the template. By default,
the template scripting language is java. To check if a
scripting language is supported, see if a configuration file exists
for the language in the conf folder of
the Jostraca distribution.
Example:
<% @conf
main.JostracaVersion = 0.4
main.TemplateScript = perl
%>
|
main.OutputFolder [ top ] | Absolute or relative folder path |
Generated files are saved to this folder. You can also specify this
setting on the command line using the -o
option, and inside the template by using the template service method
_setOutputFolder.
See:
main.WorkFolder
|
main.WorkFolder [ top ] | Absolute or relative folder path |
Files generated by Jostraca are saved to disk by the CodeWriter program. The CodeWriter program is itself created by
Jostraca as part of the generation process. The CodeWriter program is saved to a work folder. If this setting is not specified,
the work folder and the output folder are one and the same.
Setting the work folder separately allows
you to place the CodeWriter program
in a different location to the generated files. You can use this
setting to avoid polluting your source tree with CodeWriter programs.
You can specify this setting on the command line using the -w option.
See:
main.OutputFolder
Example:
jostraca -o generated-files-folder \
-w code-writer-folder
|
main.FileNameRoot [ top ] | |
The names of generated files are formed by concatenating the values
of the settings main.FileNamePrefix,
main.FileNameRoot and main.FileNameSuffix.
These settings are specified using the template service methods
_setFileNamePrefix, _setFileNameRoot and _setFileNameSuffix.
|
main.FileNamePrefix [ top ] | |
See:
main.FileNameRoot
|
main.FileNameSuffix [ top ] | |
See:
main.FileNameRoot
|
main.BackupFolder [ top ] | Absolute or relative folder path |
Previously generated files are backed up to this folder before being
overwritten. The backup file names are prefixed with a date-time
stamp followed by the value of main.BackupPrefix and suffixed with the value of
main.BackupSuffix. This setting can also
be specified on the command line using the -b option.
See:
main.BackupPrefix, main.BackupSuffix, main.MakeBackup
|
main.BackupPrefix [ top ] | |
See:
main.BackupFolder
|
main.BackupSuffix [ top ] | |
See:
main.BackupFolder
|
main.CodeWriter [ top ] | |
This setting specifies the name of the CodeWriter program. The
CodeWriter is the compiled version of the
template and is executed by Jostraca to actually create the
generated output files.
The name of the CodeWriter is formed by
concatenating the values of the settings main.CodeWriterPrefix,
main.CodeWriter and main.CodeWriterSuffix.
However, if main.CodeWriter is not defined (the default),
then the name of the CodeWriter is formed by
adding the suffix Writer to the name of the template. The name
of the template is converted to a standard form so that it
forms a valid Java variable name (non-alphanumeric characters are removed).
See:
main.CodeWriterPrefix, main.CodeWriterSuffix
|
main.CodeWriterPrefix [ top ] | |
See:
main.CodeWriter
|
main.CodeWriterSuffix [ top ] | |
See:
main.CodeWriter
|
main.MetaFolder [ top ] | Absolute or relative folder path |
A record is kept of the properties and files used
to generate each template. This metadata is saved to
a special properties file in a specified
metadata folder.
If this setting is not specified,
the metadata folder and the work folder are the same.
Setting the metadata folder separately allows
you to place the metadata properties file
in a different location to the generated files and the CodeWriter.
You can use this setting to avoid polluting your work folder with additional
property files.
You can specify this setting on the command line using the -m option.
See:
main.WorkFolder
Example:
jostraca -m metadata-folder \
-w code-writer-folder
|
main.OutputLang [ top ] | |
This option can be used to provide extra information to IDE tools
(such as CodeGenClipse)
about the target language of the generated files.
|
Process Settings |
| Setting | Type | Description |
|---|
main.ProcessStages [ top ] | |
This is an internal setting that specifies the processing stages
that will be applied to template. These processing stages can be different
for different template scripting languages. Each language specific
configuration file in the conf folder
specifies the processing stages for that language.
The process stages are dynamically defined and implementation specific
so they will not be dicussed here. However, each stage requires a special
property that defines the implemenation class for that stage. For example,
if a Preparer stage is present, then a main.process.Preparer
property must be defined.
|
Control Settings |
| Setting | Type | Description |
|---|
main.ExternalCompiler [ top ] | |
Jostraca compiles the template source code into a CodeWriter program. This
CodeWriter program must then itself be
compiled, before it can be executed by Jostraca. This compilation is
performed by an external program. This external program is the
compiler for the template scripting language used in the
template. For example, javac is used when the template
scripting language is java. The setting
main.ExternalCompiler specifies this external compiler
program.
Note that in order to use this option, you must specify an external
compiler stage with the main.process.Compiler dynamic setting.
For example, for Java, use:
main.process.Compiler = org.jostraca.process.ExternalJavaCompiler
See:
main.ExternalCompilerOptions,
main.CodeWriterCompiler
|
main.ExternalCompilerOptions [ top ] | |
This setting specifies the command line options to the external
compiler program specified by the setting main.ExternalCompiler.
See:
main.ExternalCompiler
|
main.ExternalController [ top ] | |
The CodeWriter program must be
executed to generate the output files from the template. With most
scripting languages this is performed by a command line program,
such as perl or python that executes the
CodeWriter script. The setting
main.ExternalController specifies this external
controller program.
See:
main.ExternalControllerOptions,
main.CodeWriterController
Note that in order to use this option, you must specify an external
controller stage with the main.process.Controller dynamic setting.
For example, for Java, use:
main.process.Controller = org.jostraca.process.ExternalJavaController
Also note that for most scripting languages like Perl and Python and
external controller is used by default so that changing this setting is
not necessary.
|
main.ExternalControllerOptions [ top ] | |
This setting specifies the command line options to the external
controller program specified by the setting main.ExternalController.
See:
main.ExternalController
|
main.SaveCodeWriter [ top ] | |
The CodeWriter program source code
must be saved to disk before it can be compiled and executed by
Jostraca. When this setting is set to yes (the
default) the CodeWriter program
source code is written to disk, when set to no, it is
not.
For maximum flexibility this setting is independent of the main.CompileCodeWriter and main.ExecuteCodeWriter settings.
See:
main.CompileCodeWriter, main.ExecuteCodeWriter
|
main.CompileCodeWriter [ top ] | |
This setting controls the compilation of the CodeWriter program. When this setting is
set to yes (the default) the
CodeWriter program is compiled, when set to
no, it is not.
The actual compilation is controlled by the settings main.CodeWriterCompiler and main.CodeWriterCompilerOptions.
This setting can also be specified on the command lines using the
-c option for yes, and the
-C option for no.
For maximum flexibility this setting is independent of the main.SaveCodeWriter and main.ExecuteCodeWriter settings.
See:
main.SaveCodeWriter, main.ExecuteCodeWriter
|
main.ExecuteCodeWriter [ top ] | |
This setting controls the execution of the CodeWriter program. If the
CodeWriter is not executed, no output files are
generated. When this setting is set to yes (the
default) the CodeWriter program is executed,
when set to no, it is not.
The actual execution is controlled by the settings main.CodeWriterController and main.CodeWriterControllerOptions.
This setting can also be specified on the command lines using the
-g option for yes, and the
-G option for no.
For maximum flexibility this setting is independent of the main.SaveCodeWriter and main.CompileCodeWriter settings.
See:
main.SaveCodeWriter, main.CompileCodeWriter
|
main.MakeBackup [ top ] | |
Backups of generated files are made when this setting is
set to yes (the default). Backups are not made
when this setting is set to no
The command line option -B can also
be used to turn backups off.
See:
main.BackupFolder
|
main.EnableMeta [ top ] | |
Metadata describing the template generation process is stored when this setting is
set to yes (the default). Metadata is not stored
when this setting is set to no
The command line option -M can also
be used to turn metadata off.
See:
main.MetaFolder
|
main.CodeWriterFormat [ top ] | Absolute or relative file path |
The WriterFormat is used as the framework
for the CodeWriter program.
Jostraca stores a set of basic WriterFormats in the
format subfolder of the jostraca folder.
|
Language Settings |
| Setting | Type | Description |
|---|
lang.TextQuote [ top ] | |
Literal text strings in the CodeWriter program source code must be
properly quoted using an appropriate character from the template
scripting language, which in most cases is the double quote
character: ". This character is specified in the
setting lang.TextQuote.
See:
lang.InsertPrefix, lang.InsertSuffix, lang.TemplateTextTransforms
|
lang.InsertPrefix [ top ] | |
Template text is inserted into generated files by calling an _insert
template service method in the CodeWriter program. Such method calls
appear as _insert( "text" ); in the Java version of
the CodeWriter program. Other
languages are similar. The text string is prefixed with
the value of lang.InsertPrefix, suffixed
with the value of lang.InsertSuffix and
quoted with the value of lang.TextQuote.
See:
lang.TextQuote, lang.InsertSuffix, lang.TemplateTextTransforms, lang.TemplateInsertTransforms
|
lang.InsertSuffix [ top ] | |
See:
lang.InsertPrefix
|
lang.CommentLinePrefix [ top ] | |
This setting is used to create single line comments inside the CodeWriter program. The comment is
prefixed with the value of lang.CommentLinePrefix and
suffixed with the value of lang.CommentLineSuffix. You should use the normal
symbol for the template scripting language.
See:
lang.CommentLineSuffix
|
lang.CommentLineSuffix [ top ] | |
See:
lang.CommentLinePrefix
|
lang.CommentBlockPrefix [ top ] | |
This setting is used to comment blocks of code inside the CodeWriter program. The comment block is
prefixed with the value of lang.CommentBlockPrefix and
suffixed with the value of lang.CommentBlockSuffix. You should use the
normal symbol for the template scripting language.
See:
lang.CommentBlockSuffix
|
lang.CommentBlockSuffix [ top ] | |
See:
lang.CommentBlockPrefix
|
Parse Settings |
| Setting | Type | Description |
|---|
parse.OpenOuterChar [ top ] | |
Template text and script are differentiated by placing template
script inside escape sequences such as <% and
%>.
The open outer character is the first character of the opening escape sequence, by default,
<.
See:
parse.OpenInnerChar
|
parse.OpenInnerChar [ top ] | |
The default value is %.
See:
parse.OpenOuterChar
|
parse.CloseInnerChar [ top ] | |
The default value is %.
See:
parse.OpenOuterChar.
|
parse.CloseOuterChar [ top ] | |
The default value is >.
See:
parse.OpenOuterChar
|