- java.lang.Object
-
- com.samskivert.mustache.BasicCollector
-
- com.samskivert.mustache.DefaultCollector
-
- All Implemented Interfaces:
Mustache.Collector
public class DefaultCollector extends BasicCollector
The default collector used by JMustache.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.samskivert.mustache.BasicCollector
BasicCollector.ArrayHelper
-
-
Field Summary
Fields Modifier and Type Field Description private boolean_allowAccessCoercion-
Fields inherited from class com.samskivert.mustache.BasicCollector
BOOLEAN_ARRAY_HELPER, BYTE_ARRAY_HELPER, CHAR_ARRAY_HELPER, CUSTOM_FETCHER, DOUBLE_ARRAY_HELPER, FLOAT_ARRAY_HELPER, INT_ARRAY_HELPER, ITER_FETCHER, LIST_FETCHER, LONG_ARRAY_HELPER, MAP_FETCHER, OBJECT_ARRAY_HELPER, SHORT_ARRAY_HELPER
-
-
Constructor Summary
Constructors Constructor Description DefaultCollector()DefaultCollector(boolean allowAccessCoercion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddIfaces(java.util.Set<java.lang.Class<?>> ifaces, java.lang.Class<?> clazz, boolean isIface)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.<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.protected java.lang.reflect.FieldgetField(java.lang.Class<?> clazz, java.lang.String name)protected java.lang.reflect.MethodgetIfaceMethod(java.lang.Class<?> clazz, java.lang.String name)protected java.lang.reflect.MethodgetMethod(java.lang.Class<?> clazz, java.lang.String name)protected java.lang.reflect.MethodgetMethodOn(java.lang.Class<?> clazz, java.lang.String name)private java.lang.reflect.MethodmakeAccessible(java.lang.reflect.Method m)-
Methods inherited from class com.samskivert.mustache.BasicCollector
arrayHelper, toIterator
-
-
-
-
Method Detail
-
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- Overrides:
createFetcherin classBasicCollector
-
createFetcherCache
public <K,V> java.util.Map<K,V> createFetcherCache()
Description copied from class:BasicCollectorThis 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- Specified by:
createFetcherCachein classBasicCollector
-
getMethod
protected java.lang.reflect.Method getMethod(java.lang.Class<?> clazz, java.lang.String name)
-
getIfaceMethod
protected java.lang.reflect.Method getIfaceMethod(java.lang.Class<?> clazz, java.lang.String name)
-
addIfaces
private void addIfaces(java.util.Set<java.lang.Class<?>> ifaces, java.lang.Class<?> clazz, boolean isIface)
-
getMethodOn
protected java.lang.reflect.Method getMethodOn(java.lang.Class<?> clazz, java.lang.String name)
-
makeAccessible
private java.lang.reflect.Method makeAccessible(java.lang.reflect.Method m)
-
getField
protected java.lang.reflect.Field getField(java.lang.Class<?> clazz, java.lang.String name)
-
-