使用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)有没有什么特殊的方法可以使用'@‘字符作为自定义分隔符,或者根本不允许这样做?
发布于 2012-03-27 04:47:43
@用于定义区域,是保留运算符。
https://stackoverflow.com/questions/9879547
复制相似问题