com.octo.android.robospice.persistence.springandroid
Class SpringAndroidObjectPersister<T>

java.lang.Object
  extended by com.octo.android.robospice.persistence.ObjectPersister<T>
      extended by com.octo.android.robospice.persistence.file.InFileObjectPersister<T>
          extended by com.octo.android.robospice.persistence.springandroid.SpringAndroidObjectPersister<T>
All Implemented Interfaces:
CacheCleaner, Persister
Direct Known Subclasses:
GsonObjectPersister, Jackson2ObjectPersister, JacksonObjectPersister, SimpleSerializerObjectPersister

public abstract class SpringAndroidObjectPersister<T>
extends InFileObjectPersister<T>


Constructor Summary
SpringAndroidObjectPersister(android.app.Application application, Class<T> clazz)
           
SpringAndroidObjectPersister(android.app.Application application, Class<T> clazz, File cacheFolder)
           
 
Method Summary
protected abstract  T deserializeData(String json)
           
protected  T readCacheDataFromFile(File file)
           
protected abstract  void saveData(T data, Object cacheKey)
           
 T saveDataToCacheAndReturnData(T data, Object cacheKey)
           
 
Methods inherited from class com.octo.android.robospice.persistence.file.InFileObjectPersister
fromKey, getAllCacheKeys, getCacheFile, getCacheFolder, getCachePrefix, getCreationDateInCache, getKeySanitizer, isCachedAndNotExpired, isCachedAndNotExpired, isDataInCache, isUsingKeySanitizer, loadAllDataFromCache, loadDataFromCache, removeAllDataFromCache, removeDataFromCache, setCacheFolder, setKeySanitizer, toKey
 
Methods inherited from class com.octo.android.robospice.persistence.ObjectPersister
canHandleClass, getApplication, getHandledClass, isAsyncSaveEnabled, setAsyncSaveEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringAndroidObjectPersister

public SpringAndroidObjectPersister(android.app.Application application,
                                    Class<T> clazz,
                                    File cacheFolder)
                             throws CacheCreationException
Throws:
CacheCreationException

SpringAndroidObjectPersister

public SpringAndroidObjectPersister(android.app.Application application,
                                    Class<T> clazz)
                             throws CacheCreationException
Throws:
CacheCreationException
Method Detail

readCacheDataFromFile

protected T readCacheDataFromFile(File file)
                           throws CacheLoadingException
Specified by:
readCacheDataFromFile in class InFileObjectPersister<T>
Throws:
CacheLoadingException

deserializeData

protected abstract T deserializeData(String json)
                              throws CacheLoadingException
Throws:
CacheLoadingException

saveDataToCacheAndReturnData

public T saveDataToCacheAndReturnData(T data,
                                      Object cacheKey)
                               throws CacheSavingException
Specified by:
saveDataToCacheAndReturnData in class ObjectPersister<T>
Throws:
CacheSavingException

saveData

protected abstract void saveData(T data,
                                 Object cacheKey)
                          throws IOException,
                                 CacheSavingException
Throws:
IOException
CacheSavingException


Copyright © 2012-2014. All Rights Reserved.