System.err.println(s);
JSONObject obj = new JSONObject(s);
String template = (String) obj.get("template");
JSONObject optionsDict = (JSONObject) obj.get("options");
Object dictionary = obj.get("dictionary");
TemplateCompileOptions options = new TemplateCompileOptions();
if (optionsDict.has("meta")) {
options.setMeta(optionsDict.getString("meta"));
}
if (optionsDict.has("default_formatter")) {
Object defaultFormatter = optionsDict.get("default_formatter");
if (JSONObject.NULL.equals(defaultFormatter)) {
options.setDefaultFormatter(null);
} else {
options.setDefaultFormatter(defaultFormatter.toString());
}
}
if (optionsDict.has("format_char")) {
char formatChar = optionsDict.getString("format_char").charAt(0);
options.setFormatChar(formatChar);
}
System.out.print(new Template(template, null, options)
.expand(convertObject(dictionary)));
} catch (Exception e) {
System.err.println("EXCEPTION: " + e.getClass().getSimpleName());