Java templating and codegen