DefaultMustacheFactory factory = new DefaultMustacheFactory();
factory.setObjectHandler(new ReflectionObjectHandler() {
@Override
protected boolean areMethodsAccessible(Map<?, ?> map) {
return true;
}
});
{{#job.userMetadata.entrySet}}
<tr>
<td>{{key}}</td>
<td>{{value}}</td>
</tr>
{{/job.userMetadata.entrySet}}
https://github.com/spullara/mustache.java/blob/28bab527f3e4149b858d8bc726100fe5e41516a4/compiler/src/test/java/com/github/mustachejava/MapNonGetMethodsTest.java#L49
Alternatively, you could change the type of job.userMetadata to an
entry set rather than a map in the backing code. If the type of "job"
is used for other purposes besides backing this Mustache template
though, that might be inconvenient for you. (I try to avoid exposing
types from my business logic into Mustache templates for reasons like
this -- separation of concerns.)
-Michael
> --
> You received this message because you are subscribed to the Google Groups
> "mustache.java" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
mustachejava...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.