handlebars.java
handlebars.java copied to clipboard
Collect variables AND options
Assume a template like from here:
{{blog this s="string" b=true n=678}}
Doing
String template = "{{blog this s=\"string\" b=true n=678}}";
Template t = handlebars.compileInline(template);
Collection<String> vars = t.collect(TagType.values());
System.out.println(vars);
Outputs:
[blog]
Question
I would also like to get the passed options and their valuess:
s, b, n
and "string", "true", "678"
I would want it probably as a Map.
Is this possible?
We want to use the extracted variables and values to build a UI / Form fields. The passed parameters would be configuration e.g. so that we know if we render a textfield or a dropdown, and maybe default values etc.