3

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)

'@'文字をカスタム区切り文字として使用する特別な方法はありますか、それとも単に許可されていませんか?

4

1 に答える 1

3

@は領域を定義するために使用され、予約済みの演算子です。

于 2012-03-26T20:47:42.640 に答える