ST (StringTemplate) is a java template engine (with ports for C#, Python, and Objective-C coming) for generating source code, web pages, emails, or any other formatted text output. ST is particularly good at multi-targeted code generators, multiple site skins, and internationalization / localization. It evolved over years of effort developing jGuru and then ANTLR v3.
The main website is:
Its distinguishing characteristic is that it strictly enforces model-view separation, unlike other engines. See:
The documentation is in this repo
https://github /antlr/stringtemplate4/tree/master/doc/index.md
Per the BSD license inLICENSE.txt,this software is not guaranteed to work and might even destroy all life on this planet.
All you need to do is get the StringTemplate jar into yourCLASSPATH
.SeeJava StringTemplate.
To reference StringTemplate from a project built using Maven, add the following
to the<dependencies>
element in yourpom.xmlfile.
<dependency>
<groupId>org.antlr</groupId>
<artifactId>ST4</artifactId>
<version>4.3.4</version>
<scope>compile</scope>
</dependency>
Inbuild.gradle
,add the following dependency:
dependencies {
//...
//https://mvnrepository /artifact/org.antlr/ST4
compilegroup:'org.antlr',name:'ST4',version:'4.3.4'
}
Make sure you are using themavenCentral
repository by adding it if necessary:
repositories {
//...
mavenCentral()
}
Select a version onmvnrepository, and copy the snippet relevant to your build tool.
The source is at github:
If you would like to make changes to ST and build it yourself,
just runmvn install
from the root directory of the repo.
You can also runant
from the root dir.