com.octo.android.robospice.persistence.file
Class InFileObjectPersisterFactory
java.lang.Object
com.octo.android.robospice.persistence.ObjectPersisterFactory
com.octo.android.robospice.persistence.file.InFileObjectPersisterFactory
- All Implemented Interfaces:
- CacheCleaner, Persister
- Direct Known Subclasses:
- GsonObjectPersisterFactory, Jackson2ObjectPersisterFactory, JacksonObjectPersisterFactory, JsonObjectPersisterFactory, RetrofitObjectPersisterFactory, SimpleSerializerObjectPersisterFactory
public abstract class InFileObjectPersisterFactory
- extends ObjectPersisterFactory
- implements CacheCleaner
A factory that will create ObjectPersister
instances that save/load
data in a file.
- Author:
- sni
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InFileObjectPersisterFactory
public InFileObjectPersisterFactory(android.app.Application application)
throws CacheCreationException
- Throws:
CacheCreationException
InFileObjectPersisterFactory
public InFileObjectPersisterFactory(android.app.Application application,
File cacheFolder)
throws CacheCreationException
- Throws:
CacheCreationException
InFileObjectPersisterFactory
public InFileObjectPersisterFactory(android.app.Application application,
List<Class<?>> listHandledClasses)
throws CacheCreationException
- Throws:
CacheCreationException
InFileObjectPersisterFactory
public InFileObjectPersisterFactory(android.app.Application application,
List<Class<?>> listHandledClasses,
File cacheFolder)
throws CacheCreationException
- Throws:
CacheCreationException
setCacheFolder
public void setCacheFolder(File cacheFolder)
throws CacheCreationException
- Sets the folder used by object persisters of this factory.
- Parameters:
cacheFolder
- the new cache folder of this factory (and persisters it will
create). Ca be null, it will then default to the sub folder
InFileObjectPersister.DEFAULT_ROOT_CACHE_DIR
in side
the application cache folder. Will be created if doesn't exist
yet.
- Throws:
CacheCreationException
setCachePrefix
public void setCachePrefix(String cachePrefix)
- Sets the cachePrefix used by object persisters of this factory.
- Parameters:
cachePrefix
- the new cache cachePrefix of this factory (and persisters it
will create). Defaults to "className".
getCacheFolder
public File getCacheFolder()
getCachePrefix
public String getCachePrefix()
getKeySanitizer
public KeySanitizer getKeySanitizer()
setKeySanitizer
public void setKeySanitizer(KeySanitizer keySanitizer)
- Parameters:
keySanitizer
- the new key sanitizer to be used by this
InFileObjectPersisterFactory
and persisters. May be
null, in that case no key sanitation will be used. This is the
default.
createObjectPersister
public final <T> InFileObjectPersister<T> createObjectPersister(Class<T> clazz)
- Description copied from class:
ObjectPersisterFactory
- Creates a
ObjectPersister
for a given class.
- Specified by:
createObjectPersister
in class ObjectPersisterFactory
- Parameters:
clazz
- the class of the items that need to be saved/loaded from
cache.
- Returns:
- a
ObjectPersister
able to load/save instances of class
clazz.
createInFileObjectPersister
public abstract <T> InFileObjectPersister<T> createInFileObjectPersister(Class<T> clazz,
File cacheFolder)
throws CacheCreationException
- Throws:
CacheCreationException
removeAllDataFromCache
public void removeAllDataFromCache()
- Specified by:
removeAllDataFromCache
in interface CacheCleaner
Copyright © 2012-2014. All Rights Reserved.