Reputation: 876
I am trying to use stringtemplate-4 engine in android.
But I need starting delimiter,
" {{ "
while ending delimiter should be,
" }} "
Here, I think only char delimiters are allowed. So how to use string delimiters?
Thnx in advance.
Upvotes: 2
Views: 911
Reputation: 99859
StringTemplate only supports using single characters as the delimiter. This limitation is coded in several places, including but not limited to the following.
STGroup
constructors, and the delimiterStartChar
and delimiterStopChar
fields of the same class are represented as the type char
, not String
.STLexer
constructors face a similar restriction. In addition, the lexer implementation only uses a single-character lookahead operation to identify delimiters.You would need to fork the project and rewrite several portions of the code to support arbitrary strings as delimiters.
Upvotes: 4