How to convert efficiently a Java object to SoyData in Google Closure

305 Views Asked by At

We have a Java object with data that we want to use for template rendering - is there an efficient way of converting Java object to SoyData?

Currently we are using gson to convert it to tree and recursively populate SoyData object, but maybe there is something that wouldn't require gson conversion.

1

There are 1 best solutions below

0
alobodzk On BEST ANSWER

So in the end I added a constraint that the data can be only in a form of a map and I was able to use a library object com.google.template.soy.data.SoyMapData to do the work.