/** * Get a singleton instance of this class to work with (stored statically) <br/> * <b>WARNING</b>: do not hold onto this object or cache it yourself, call this method again if you need it again * @return a singleton instance of this class */ public static ClassDataCacher getInstance() { ClassDataCacher instance = (instanceStorage == null ? null : instanceStorage.get()); if (instance == null) { instance = ClassDataCacher.setInstance(null); } return instance; } /**
/** * Get a singleton instance of this class to work with (stored statically) <br/> * <b>WARNING</b>: do not hold onto this object or cache it yourself, call this method again if you need it again * @return a singleton instance of this class */ public static ClassDataCacher getInstance() { ClassDataCacher instance = (instanceStorage == null ? null : instanceStorage.get()); if (instance == null) { instance = ClassDataCacher.setInstance(null); } return instance; } /**
/** * 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); }