2021-04-28 14:48:01 +00:00
|
|
|
hello = function () {
|
|
|
|
include('options.js');
|
2021-04-29 12:06:43 +00:00
|
|
|
|
|
|
|
// Instanciation
|
2021-04-30 22:34:15 +00:00
|
|
|
Packages.java.lang.System.out.println("<new Options(authorAccess, 'hello', 3)>");
|
|
|
|
var options = new Options(authorAccess, 'hello', 3);
|
|
|
|
Packages.java.lang.System.out.println("</new Options(authorAccess, 'hello', 3)");
|
|
|
|
|
2021-04-29 12:06:43 +00:00
|
|
|
// Set up a couple of options
|
2021-04-28 14:48:01 +00:00
|
|
|
options.setOption('Hello', 'World');
|
|
|
|
options.setOption('See you later', 'aligator');
|
2021-04-29 12:06:43 +00:00
|
|
|
|
|
|
|
// Retrieve and display these options
|
2021-04-28 14:48:01 +00:00
|
|
|
var myOptions = options.getOptions();
|
|
|
|
for (var key in myOptions) {
|
|
|
|
var value = myOptions[key];
|
|
|
|
Packages.java.lang.System.out.println(key + ' ' + value);
|
|
|
|
}
|
2021-04-29 12:06:43 +00:00
|
|
|
|
|
|
|
// Do the same with file specific options
|
2021-05-01 10:34:21 +00:00
|
|
|
Packages.java.lang.System.out.println("<options.setSystemId(undefined, 2)>");
|
|
|
|
options.setSystemId(null, 2);
|
|
|
|
Packages.java.lang.System.out.println("</options.setSystemId(undefined, 2)>");
|
2021-04-29 10:04:41 +00:00
|
|
|
options.setSystemIdOption('Hello', 'aligator');
|
|
|
|
options.setSystemIdOption('See you later', 'World');
|
|
|
|
var myOptions = options.getSystemIdOptions();
|
|
|
|
for (var key in myOptions) {
|
|
|
|
var value = myOptions[key];
|
|
|
|
Packages.java.lang.System.out.println(key + ' ' + value);
|
|
|
|
}
|
2021-04-29 12:06:43 +00:00
|
|
|
|
|
|
|
// Display some file specific properties
|
2021-04-29 09:32:07 +00:00
|
|
|
Packages.java.lang.System.out.println('options.systemId: ' + options.systemId);
|
|
|
|
Packages.java.lang.System.out.println('options.systemIdDigest: ' + options.systemIdDigest);
|
2021-05-01 10:34:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
Packages.java.lang.System.out.println("<new Options(authorAccess, 'hello2', 20)>");
|
|
|
|
var options = new Options(authorAccess, 'hello2', 20);
|
|
|
|
Packages.java.lang.System.out.println("</new Options>");
|
|
|
|
|
|
|
|
// Delete options
|
|
|
|
|
|
|
|
// Packages.java.lang.System.out.println('Deleting options');
|
|
|
|
// options.deleteOption ('Hello');
|
|
|
|
// options.deleteOption ('See you later');
|
|
|
|
// myOptions = options.getOptions();
|
|
|
|
// for (var key in myOptions) {
|
|
|
|
// var value = myOptions[key];
|
|
|
|
// Packages.java.lang.System.out.println(key + ' ' + value);
|
|
|
|
// }
|
2021-04-30 22:34:15 +00:00
|
|
|
}
|