- java.lang.Object
-
- com.samskivert.mustache.BasicCollector
-
- All Implemented Interfaces:
Mustache.Collector
- Direct Known Subclasses:
DefaultCollector
public abstract class BasicCollector extends java.lang.Object implements Mustache.Collector
A collector that does not use reflection and can be used with GWT.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBasicCollector.ArrayHelper
-
Field Summary
Fields Modifier and Type Field Description protected static BasicCollector.ArrayHelperBOOLEAN_ARRAY_HELPERprotected static BasicCollector.ArrayHelperBYTE_ARRAY_HELPERprotected static BasicCollector.ArrayHelperCHAR_ARRAY_HELPERprotected static Mustache.VariableFetcherCUSTOM_FETCHERprotected static BasicCollector.ArrayHelperDOUBLE_ARRAY_HELPERprotected static BasicCollector.ArrayHelperFLOAT_ARRAY_HELPERprotected static BasicCollector.ArrayHelperINT_ARRAY_HELPERprotected static Mustache.VariableFetcherITER_FETCHERprotected static Mustache.VariableFetcherLIST_FETCHERprotected static BasicCollector.ArrayHelperLONG_ARRAY_HELPERprotected static Mustache.VariableFetcherMAP_FETCHERprotected static BasicCollector.ArrayHelperOBJECT_ARRAY_HELPERprotected static BasicCollector.ArrayHelperSHORT_ARRAY_HELPER
-
Constructor Summary
Constructors Constructor Description BasicCollector()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static BasicCollector.ArrayHelperarrayHelper(java.lang.Object ctx)Mustache.VariableFetchercreateFetcher(java.lang.Object ctx, java.lang.String name)Creates a fetcher for a so-named variable in the supplied context object, which will never be null.abstract <K,V>
java.util.Map<K,V>createFetcherCache()This should return a thread-safe map, eitherCollections.synchronizedMap(java.util.Map<K, V>)called on a standardMapimplementation or something likeConcurrentHashMap.java.util.Iterator<?>toIterator(java.lang.Object value)Returns an iterator that can iterate over the supplied value, or null if the value is not a collection.
-
-
-
Field Detail
-
CUSTOM_FETCHER
protected static final Mustache.VariableFetcher CUSTOM_FETCHER
-
MAP_FETCHER
protected static final Mustache.VariableFetcher MAP_FETCHER
-
LIST_FETCHER
protected static final Mustache.VariableFetcher LIST_FETCHER
-
ITER_FETCHER
protected static final Mustache.VariableFetcher ITER_FETCHER
-
OBJECT_ARRAY_HELPER
protected static final BasicCollector.ArrayHelper OBJECT_ARRAY_HELPER
-
BOOLEAN_ARRAY_HELPER
protected static final BasicCollector.ArrayHelper BOOLEAN_ARRAY_HELPER
-
BYTE_ARRAY_HELPER
protected static final BasicCollector.ArrayHelper BYTE_ARRAY_HELPER
-
CHAR_ARRAY_HELPER
protected static final BasicCollector.ArrayHelper CHAR_ARRAY_HELPER
-
SHORT_ARRAY_HELPER
protected static final BasicCollector.ArrayHelper SHORT_ARRAY_HELPER
-
INT_ARRAY_HELPER
protected static final BasicCollector.ArrayHelper INT_ARRAY_HELPER
-
LONG_ARRAY_HELPER
protected static final BasicCollector.ArrayHelper LONG_ARRAY_HELPER
-
FLOAT_ARRAY_HELPER
protected static final BasicCollector.ArrayHelper FLOAT_ARRAY_HELPER
-
DOUBLE_ARRAY_HELPER
protected static final BasicCollector.ArrayHelper DOUBLE_ARRAY_HELPER
-
-
Method Detail
-
toIterator
public java.util.Iterator<?> toIterator(java.lang.Object value)
Description copied from interface:Mustache.CollectorReturns an iterator that can iterate over the supplied value, or null if the value is not a collection.- Specified by:
toIteratorin interfaceMustache.Collector
-
createFetcher
public Mustache.VariableFetcher createFetcher(java.lang.Object ctx, java.lang.String name)
Description copied from interface:Mustache.CollectorCreates 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().- Specified by:
createFetcherin interfaceMustache.Collector
-
createFetcherCache
public abstract <K,V> java.util.Map<K,V> createFetcherCache()
This should return a thread-safe map, eitherCollections.synchronizedMap(java.util.Map<K, V>)called on a standardMapimplementation or something likeConcurrentHashMap.- Specified by:
createFetcherCachein interfaceMustache.Collector
-
arrayHelper
protected static BasicCollector.ArrayHelper arrayHelper(java.lang.Object ctx)
-
-