如何添加注释
<! 这是注释 !>
如何忽略前后空白
<if(!map.alarmTypeIsDown)> ${ N}<if(map.legoLogo)><endif>${ N}<map.fullMsg><else>${ N} <if(map.legoLogo)><endif> <if(map.dingChartUrl)><endif> ${ N}**告警简述**:<if(map.pLevel)><map.pLevel>,<endif><if(map.sLevel)><map.sLevel>,<endif><map.alertTime>,[<map.pName>][<map.bpName>.<map.dimCombineName>.<map.quotaName>],<map.fallRange>分钟累计跌幅<map.fallPer>. <if(map.bpNames)> **告警关联**:[<map.bpNames;separator=",">]<endif> <if(map.decision)> **决策结果**:[<map.decision>]<endif> <endif>
如何使用函数将模板管理的更加方便
https://github.com/antlr/stringtemplate4/blob/master/doc/cheatsheet.md#functions

如何将参数在子模板中一路透传
子函数内的内容自动缩进
STGroup stGroup = new STGroup();stGroup.defineTemplate("main", "", "\n" + "{\n" + " \t<childStatement()>\n" + "}\n" + "");stGroup.defineTemplate("childStatement", "", "select <columns;separator=\",\">\n" + "from table\n" + "where 1=1 <if(condition)>and <condition><endif>");System.out.println(stGroup.getInstanceOf("main").render());