0

In my project, I am using StringTemplate files to generate java code extensively. I am keeping all StringTemplate files in one folder. Now, I want to group StringTemplate files according to their category into different folders. I am using the following way to get instance of String template file.

StringTemplate templateOfSensorDriver = group.getInstanceOf("sensordriver");
// In this code, I am getting instance of sensordriver.st file 
  using getInstanceOf() method.

Can you please suggest me how can I give path of specific folder using getInstaceOf() method ?

user-517752
  • 1,188
  • 5
  • 21
  • 54

1 Answers1

1

Assuming you are using StringTemplate 4, you can qualify your template names. The STGroupDir group will change the path to folders.

group.getInstanceOf("path/to/sensordriver");
Sam Harwell
  • 97,721
  • 20
  • 209
  • 280