简体   繁体   English

如何将大量的Stringtemplate文件组织到不同的文件夹中

[英]How can I organize a large number of Stringtemplate files into different folders

In my project, I am using StringTemplate files to generate java code extensively . 在我的项目中,我正在使用StringTemplate文件广泛地生成Java代码。 I am keeping all StringTemplate files in one folder . 我将所有StringTemplate文件保留在一个文件夹中 Now, I want to group StringTemplate files according to their category into different folders. 现在,我想根据其类别将StringTemplate文件分组到不同的文件夹中。 I am using the following way to get instance of String template file. 我正在使用以下方式获取String模板文件的实例。

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 ? 您能建议我如何使用getInstaceOf()方法给出特定文件夹的路径吗?

Assuming you are using StringTemplate 4, you can qualify your template names. 假设您正在使用StringTemplate 4,则可以限定模板名称。 The STGroupDir group will change the path to folders. STGroupDir组将更改文件夹的路径。

group.getInstanceOf("path/to/sensordriver");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在NetBeans中手动组织文件和文件夹? - How to manually organize files and folders in NetBeans? 如何在Google App Engine中使用StringTemplate文件? - How do I use StringTemplate files in Google App Engine? Java将子类组织到不同的文件夹中 - Java organize subclasses into different folders 如何在netbeans中组织不同的Java源文件夹(以进行测试)? - How to organize different java source folders in netbeans (for testing)? 如何在Spring Batch中从两个不同的文件夹中读取多个xml文件? - How can I read multiple xml files from two different folders in Spring Batch? 如何在eclipse项目中有2个同名文件但在2个不同的子文件夹中? - How can I have 2 files of the same name in an eclipse project but in 2 different sub-folders? 我可以在制作课程后将课程组织到文件夹中,它们仍可以使用吗? - Can I organize classes into folders after making them and they will still work? 如何编写大量的 for 循环 - how can I program a large number of for loops 如何确定将大量文件复制到外部共享文件夹的并行Java线程的理想数量? - How can I determine the ideal number of parallel java threads for copying a large set of files to an external shared folder? 如何有效地并行运行大量文件的XSLT转换? - How can I efficiently run XSLT transformations for a large number of files in parallel?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM