Frage

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 ?

War es hilfreich?

Lösung

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");
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top