是否可以StringTemplate支持可重用

问题描述:

我想遍历存储在任意数据结构中的数据集合。我唯一的界面是Iterable。这是可能的StringTemplate?是否可以StringTemplate支持可重用

<source:{e|e.stuff}> 



class Source<HasStuff> implements Iterable<HasStuff> { 
    // Implementation 
} 

当前版本(4.0.7)支持Iterator,但不支持Iterable。有关详细信息,请参阅以下方法,该方法返回Iterator以用于映射操作。

https://github.com/antlr/stringtemplate4/blob/4.0.7/src/org/stringtemplate/v4/Interpreter.java#L1112-L1132