The Data Exchanger component API consists of the following method:
-
getString("program"), set("program", pgm). This method
allows you to get/set the whole Data Exchange program. The program must
include the renaming comment at the top. The following is a simple example:
// DATA EXCHANGE PROGRAM - DO NOT EDIT THIS COMMENT
//parameter "filename" as filename
//parameter "sample" as sample
//parameter "sample Tmpl" as sample Tmpl
//parameter "v1" as v1
//END COMMENT
sample2 = new Partitioner(Tool.RANDOM, new
FileExchanger(C_, sample_Tmpl, sample_Tmpl), null);
sample2.word(1, 6).write(filename);
table = sample2.mark("table");
sample2.word(table.line(1), 2).write(v1);
For each parameter being used, including file parameters, there must be
a comment at the start with exactly the following format:
//parameter "parameter" as variable
The field parameter is the parameter name (which may
contain spaces or punctuation). The variable is the
name of a Java variable that is associated with the program. This name
must follow Java naming conventions:
-
Start with a letter
-
Continue with letters, digits, or underscore
-
Case sensitive, unlike Isight
parameters which are case-insensitive
-
Must not match the name of a Java reserved word
-
Avoid names that will clash with Java classes, such as system, table,
or tool
If the parameter name is a valid variable name, the two strings can be
the same (and they usually are).
In the above example, the Java variables sample2
and table are Java variables, not parameters. Therefore,
they are not included in the renaming comment.
The strings
// DATA EXCHANGE PROGRAM - DO NOT EDIT THIS COMMENT
and
//END COMMENT
must appear exactly as shown.