Java Stringtemplate-4:使用'@';作为自定义分隔符

Java Stringtemplate-4:使用'@';作为自定义分隔符,java,stringtemplate-4,Java,Stringtemplate 4,使用StringTemplate 4.0.2时,请执行以下对象构造: ST st = new ST("@myToken@", '@', '@'); 生成异常: 1:8: '@' came as a complete surprise to me Exception in thread "main" org.stringtemplate.v4.compiler.STException at org.stringtemplate.v4.compiler.Compiler.reportMes

使用StringTemplate 4.0.2时,请执行以下对象构造:

ST st = new ST("@myToken@", '@', '@');
生成异常:

1:8: '@' came as a complete surprise to me
Exception in thread "main" org.stringtemplate.v4.compiler.STException
    at org.stringtemplate.v4.compiler.Compiler.reportMessageAndThrowSTException(Compiler.java:213)
    at org.stringtemplate.v4.compiler.Compiler.compile(Compiler.java:143)
    at org.stringtemplate.v4.STGroup.compile(STGroup.java:427)
    at org.stringtemplate.v4.ST.<init>(ST.java:142)
    at org.stringtemplate.v4.ST.<init>(ST.java:136)
1:8:“@”的出现让我大吃一惊
线程“main”org.stringtemplate.v4.compiler.STException中出现异常
位于org.stringtemplate.v4.compiler.compiler.ReportMessageandRowstException(compiler.java:213)
位于org.stringtemplate.v4.compiler.compiler.compile(compiler.java:143)
位于org.stringtemplate.v4.STGroup.compile(STGroup.java:427)
位于org.stringtemplate.v4.ST.(ST.java:142)
位于org.stringtemplate.v4.ST.(ST.java:136)

使用“@”字符作为自定义分隔符有什么特别的方法吗?还是根本不允许使用它?

@用于定义区域,并且是保留运算符。

在调用以“@”作为分隔符的构造函数时,可以引发异常。我花了很长时间才发现这就是它不起作用的原因。