com.octo.android.robospice.persistence.springandroid.json.gson
Class GsonObjectPersister<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>
              extended by com.octo.android.robospice.persistence.springandroid.json.gson.GsonObjectPersister<T>
All Implemented Interfaces:
CacheCleaner, Persister

public final class GsonObjectPersister<T>
extends SpringAndroidObjectPersister<T>


Constructor Summary
GsonObjectPersister(android.app.Application application, Class<T> clazz)
           
GsonObjectPersister(android.app.Application application, Class<T> clazz, File cacheFolder)
           
 
Method Summary
protected  T deserializeData(String json)
           
protected  void saveData(T data, Object cacheKey)
           
 
Methods inherited from class com.octo.android.robospice.persistence.springandroid.SpringAndroidObjectPersister
readCacheDataFromFile, saveDataToCacheAndReturnData
 
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

GsonObjectPersister

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

GsonObjectPersister

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

deserializeData

protected T deserializeData(String json)
Specified by:
deserializeData in class SpringAndroidObjectPersister<T>

saveData

protected void saveData(T data,
                        Object cacheKey)
                 throws IOException,
                        CacheSavingException
Specified by:
saveData in class SpringAndroidObjectPersister<T>
Throws:
IOException
CacheSavingException


Copyright © 2012-2014. All Rights Reserved.