- All Known Implementing Classes:
BasicCollector
,DefaultCollector
- Enclosing class:
Mustache
public static interface Mustache.Collector
Handles interpreting objects as collections.
-
Method Summary
Modifier and TypeMethodDescriptioncreateFetcher
(Object ctx, String name) Creates a fetcher for a so-named variable in the supplied context object, which will never be null.<K,
V> Map <K, V> Creates a map to be used to cacheMustache.VariableFetcher
instances.Iterator
<?> toIterator
(Object value) Returns an iterator that can iterate over the supplied value, or null if the value is not a collection.
-
Method Details
-
toIterator
Returns an iterator that can iterate over the supplied value, or null if the value is not a collection. -
createFetcher
Creates a fetcher for a so-named variable in the supplied context object, which will never be null. The fetcher will be cached and reused for future contexts for whichoctx.getClass().equals(nctx.getClass()
. -
createFetcherCache
Creates a map to be used to cacheMustache.VariableFetcher
instances. The GWT-compatible collector returns a HashMap here, but the reflection based fetcher (which only works on the JVM and Android, returns a concurrent hashmap.
-