handlebars.java
handlebars.java copied to clipboard
Scala Support
I wrote a small adaptor allowing handlebars.java to be used with native Scala types (Scala collections and working with Scala reflection)
Gist here: https://gist.github.com/kevinwright/359329efcb166ec4f6ce59a228ee715f
Probably not a good idea to add to the core project because of the dependency it would introduce, but is this something you'd be interested in having as an "official" add-on module?
Of course, will wait for pull request.
Thanks
FWIW, we got around this by implementing a method that converts scala collections to java collections, and make sure to always use that when providing a model/context. Implementing a resolver for scala types like you're suggesting seems more elegant!
I'm a bit wary of the reflective resolver though; maybe create two new resolvers, one just for collections, and another that includes reflection?