Пример парсинга json для наглядности:
importClass(java.io.File);
importClass(java.io.FileReader);
importClass(java.io.BufferedReader);
var configFile = new File('config.json');
if (!configFile) {
throw new Error('Can not find configuration file in "' + basedir + File.separator + 'config.json"');
}
var buffer = new BufferedReader(new FileReader(configFile)),
cfgString = '',
line;
while (line = buffer.readLine()) {
cfgString += line;
}
var CONFIG = eval('(' + cfgString + ')');