Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.octo.android.robospice.persistence;
 
Super class of all factories of ObjectPersisterFactory classes. They are responsible for creating ObjectPersister classes that will save/load data for a given class. Such factories are useful because we sometimes need to create ObjectPersister dynamically. For instance when we serialize items as JSON, we need to create a new ObjectPersister class for every class of items saved/loaded into cache. A unique ObjectPersister would not be able to strongly type the load/save method and we would have to cast the result of both operations, leading to less robust and less convenient code.

Author(s):
sni
public abstract class ObjectPersisterFactory {
    private Application mApplication;
    protected boolean isAsyncSaveEnabled;

    

Parameters:
application the android context needed to access android file system or databases to store.
    public ObjectPersisterFactoryApplication application ) {
        this. = application;
    }
    protected final Application getApplication() {
        return ;
    }

    
Wether or not this bus element can persist/unpersist objects of the given class clazz.

Parameters:
clazz the class of objets we are looking forward to persist.
Returns:
true if this bus element can persist/unpersist objects of the given class clazz. False otherwise.
    public abstract boolean canHandleClassClass< ? > clazz );

    
Creates a ObjectPersister for a given class.

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.
    public abstract < DATA > ObjectPersister< DATA > createClassCacheManagerClass< DATA > clazz );

    
Removes all data from cache that has been saved by the ObjectPersister instances created by the factory.
    public abstract void removeAllDataFromCache();
    public void setAsyncSaveEnabledboolean isAsyncSaveEnabled ) {
        this. = isAsyncSaveEnabled;
    }
    public boolean isAsyncSaveEnabled() {
        return ;
    }
New to GrepCode? Check out our FAQ X