Calling Java function with arguments from StringTemplate?
问题 StringTemplate allows programmers to fetch data through getters(a function with no arguments). I would like to know that Is it possible to call Java function with arguments from String Template? 回答1: There is a workaround by abusing dictionaries. Here is an example of implementing "function" for limiting item count in a List (issue on github). In your code add dictionary: group.defineDictionary("max", new MaxListItemsLimiter()); Usage (in this example first item in array is max. items count):