/** * Set the cache to be used for holding the reflection data, * this allows control over where the reflection caches are stored, * this should store the data in a way that it will not hold open the classloader the class comes from <br/> * Note that you can set this to a map implementation which does not store anything to disable caching if you like * * @param reflectionCache a cache for holding class cache data (implements map), null to use the default internal cache */ @SuppressWarnings("unchecked") public void setReflectionCache(Map<Class<?>, ClassFields> reflectionCache) { getClassDataCacher().setReflectionCache(reflectionCache); }
/** * Set the cache to be used for holding the reflection data, * this allows control over where the reflection caches are stored, * this should store the data in a way that it will not hold open the classloader the class comes from <br/> * Note that you can set this to a map implementation which does not store anything to disable caching if you like * * @param reflectionCache a cache for holding class cache data (implements map), null to use the default internal cache */ @SuppressWarnings("unchecked") public void setReflectionCache(Map<Class<?>, ClassFields> reflectionCache) { getClassDataCacher().setReflectionCache(reflectionCache); }
/** * Construct and specify the field finding mode and your own cache when caching class data, must implement the standard map interface but * only the following methods are required:<br/> * {@link Map#clear()}, {@link Map#size()}, {@link Map#put(Object, Object)}, {@link Map#get(Object)} <br/> * <br/> * <b>WARNING:</b> if you don't need this control then just use the {@link #getInstance()} method to get this * * @param fieldFindMode the mode when looking up fields in classes (null for default of {@link FieldFindMode#HYBRID}) * @param reflectionCache a map implementation to use as the cache mechanism (null to use internal) */ @SuppressWarnings("unchecked") public ClassDataCacher(FieldFindMode fieldFindMode, Map<Class<?>, ClassFields> reflectionCache) { setFieldFindMode(fieldFindMode); setReflectionCache(reflectionCache); ClassDataCacher.setInstance(this); }
/** * Construct and specify the field finding mode and your own cache when caching class data, must implement the standard map interface but * only the following methods are required:<br/> * {@link Map#clear()}, {@link Map#size()}, {@link Map#put(Object, Object)}, {@link Map#get(Object)} <br/> * <br/> * <b>WARNING:</b> if you don't need this control then just use the {@link #getInstance()} method to get this * * @param fieldFindMode the mode when looking up fields in classes (null for default of {@link FieldFindMode#HYBRID}) * @param reflectionCache a map implementation to use as the cache mechanism (null to use internal) */ @SuppressWarnings("unchecked") public ClassDataCacher(FieldFindMode fieldFindMode, Map<Class<?>, ClassFields> reflectionCache) { setFieldFindMode(fieldFindMode); setReflectionCache(reflectionCache); ClassDataCacher.setInstance(this); }