code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
public void createOrUpdateCacheEntryInDatabase(CacheEntry cacheEntry) throws SQLException {
if (cacheEntry != null) {
Dao<CacheEntry, ?> dao = getDao(CacheEntry.class);
dao.createOrUpdate(cacheEntry);
}
} | Helper class which creates/updates our database and provides the DAOs. | createOrUpdateCacheEntryInDatabase | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T> List<T> queryForAllFromDatabase(Class<T> modelObjectClass) throws SQLException {
List<T> allObjectsInTable = new ArrayList<T>();
Dao<T, ?> dao = getDao(modelObjectClass);
allObjectsInTable.addAll(dao.queryForAll());
return allObjectsInTable;
} | Helper class which creates/updates our database and provides the DAOs. | queryForAllFromDatabase | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T, ID> T queryForIdFromDatabase(ID id, Class<T> modelObjectClass) throws SQLException {
Dao<T, ID> dao = getDao(modelObjectClass);
T result = dao.queryForId(id);
return result;
} | Helper class which creates/updates our database and provides the DAOs. | queryForIdFromDatabase | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public CacheEntry queryCacheKeyForIdFromDatabase(String id) throws SQLException {
Dao<CacheEntry, String> dao = getDao(CacheEntry.class);
return dao.queryForId(id);
} | Helper class which creates/updates our database and provides the DAOs. | queryCacheKeyForIdFromDatabase | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T, ID> void deleteByIdFromDataBase(ID id, Class<T> modelObjectClass) throws SQLException {
Dao<T, ID> dao = getDao(modelObjectClass);
dao.deleteById(id);
} | Helper class which creates/updates our database and provides the DAOs. | deleteByIdFromDataBase | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T> void clearTableFromDataBase(Class<T> modelObjectClass) throws SQLException {
try {
clearTable(modelObjectClass);
} catch (Exception ex) {
Ln.d(ex, "An exception occurred when cleaning table");
}
} | Helper class which creates/updates our database and provides the DAOs. | clearTableFromDataBase | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
private <T> void clearTable(Class<T> clazz) throws SQLException {
for (Field field : clazz.getDeclaredFields()) {
ForeignCollectionField annotation = field.getAnnotation(ForeignCollectionField.class);
if (annotation != null) {
ParameterizedType stringListType = (Parameter... | Helper class which creates/updates our database and provides the DAOs. | clearTable | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T> void deleteFromDataBase(Collection<T> objectList, Class<T> modelObjectClass) throws SQLException {
if (objectList != null && !objectList.isEmpty()) {
Dao<T, ?> dao = getDao(modelObjectClass);
dao.delete(objectList);
}
} | Helper class which creates/updates our database and provides the DAOs. | deleteFromDataBase | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T> void createInDatabaseIfNotExist(T modelObject, Class<T> modelObjectClass) throws SQLException {
if (modelObject != null) {
Dao<T, ?> dao = getDao(modelObjectClass);
dao.createIfNotExists(modelObject);
}
} | Helper class which creates/updates our database and provides the DAOs. | createInDatabaseIfNotExist | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T> void deleteFromDataBase(T modelObject, Class<T> modelObjectClass) throws SQLException {
if (modelObject != null) {
Dao<T, ?> dao = getDao(modelObjectClass);
dao.delete(modelObject);
}
} | Helper class which creates/updates our database and provides the DAOs. | deleteFromDataBase | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T> void deleteFromDataBase(ForeignCollection<T> modelObjectCollection, Class<T> modelObjectClass) throws SQLException {
if (modelObjectCollection != null) {
Dao<T, ?> dao = getDao(modelObjectClass);
dao.delete(modelObjectCollection);
}
} | Helper class which creates/updates our database and provides the DAOs. | deleteFromDataBase | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T> long countOfAllObjectsOfTable(Class<T> modelObjectClass) throws SQLException {
Dao<T, ?> dao = getDao(modelObjectClass);
return dao.countOf();
} | Helper class which creates/updates our database and provides the DAOs. | countOfAllObjectsOfTable | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
public <T, FT> ForeignCollection<FT> getNewEmptyForeignCollection(String foreignKeyColumnName, Class<T> modelObjectClass, Class<FT> foreignObjectClass) throws SQLException {
Dao<T, ?> dao = getDao(modelObjectClass);
return dao.getEmptyForeignCollection(foreignKeyColumnName);
} | Helper class which creates/updates our database and provides the DAOs. | getNewEmptyForeignCollection | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
@Override
public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource, int oldVersion, int newVersion) {
// override if needed
} | Helper class which creates/updates our database and provides the DAOs. | onUpgrade | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
@Override
public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {
// override if needed
} | Helper class which creates/updates our database and provides the DAOs. | onCreate | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite/src/main/java/com/octo/android/robospice/persistence/ormlite/RoboSpiceDatabaseHelper.java | Apache-2.0 |
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("id=").append(id);
sb.append(", ").append("string=").append(string);
sb.append(", ").append("millis=").append(millis);
SimpleDateFormat dateFormatter = new SimpleDateFormat(
"MM... | A simple demonstration object we are creating and persisting to the database. | toString | java | stephanenicolas/robospice | extensions/robospice-ormlite-parent/robospice-ormlite-test/src/main/java/com/octo/android/robospice/ormlite/test/model/SimpleData.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ormlite-parent/robospice-ormlite-test/src/main/java/com/octo/android/robospice/ormlite/test/model/SimpleData.java | Apache-2.0 |
public Class<R> getRetrofitedInterfaceClass() {
return retrofitedInterfaceClass;
} | A simplified {@link SpiceRequest} that makes it even easier to use a
retrofited REST service.
@author SNI
@param <T>
the result type of this request.
@param <R>
the retrofited interface used by this request. | getRetrofitedInterfaceClass | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/request/retrofit/RetrofitSpiceRequest.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/request/retrofit/RetrofitSpiceRequest.java | Apache-2.0 |
public void setService(R service) {
this.service = service;
} | A simplified {@link SpiceRequest} that makes it even easier to use a
retrofited REST service.
@author SNI
@param <T>
the result type of this request.
@param <R>
the retrofited interface used by this request. | setService | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/request/retrofit/RetrofitSpiceRequest.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/request/retrofit/RetrofitSpiceRequest.java | Apache-2.0 |
public R getService() {
return service;
} | A simplified {@link SpiceRequest} that makes it even easier to use a
retrofited REST service.
@author SNI
@param <T>
the result type of this request.
@param <R>
the retrofited interface used by this request. | getService | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/request/retrofit/RetrofitSpiceRequest.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/request/retrofit/RetrofitSpiceRequest.java | Apache-2.0 |
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
CacheManager cacheManager = new CacheManager();
cacheManager.addPersister(new GsonRetrofitObjectPersisterFactory(application, getConverter(), getCacheFolder()));
return cacheManager;
... | A pre-set, easy to use, retrofit service. It will use retrofit for network
requests and both networking and caching will use Gson. To use it, just add
to your manifest :
<pre>
<service
android:name="com.octo.android.robospice.retrofit.RetrofitGsonSpiceService"
android:exported="false" />
</pre>
@author SNI | createCacheManager | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitGsonSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitGsonSpiceService.java | Apache-2.0 |
@Override
protected Converter createConverter() {
return new GsonConverter(new Gson());
} | A pre-set, easy to use, retrofit service. It will use retrofit for network
requests and both networking and caching will use Gson. To use it, just add
to your manifest :
<pre>
<service
android:name="com.octo.android.robospice.retrofit.RetrofitGsonSpiceService"
android:exported="false" />
</pre>
@author SNI | createConverter | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitGsonSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitGsonSpiceService.java | Apache-2.0 |
public File getCacheFolder() {
return null;
} | A pre-set, easy to use, retrofit service. It will use retrofit for network
requests and both networking and caching will use Gson. To use it, just add
to your manifest :
<pre>
<service
android:name="com.octo.android.robospice.retrofit.RetrofitGsonSpiceService"
android:exported="false" />
</pre>
@author SNI | getCacheFolder | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitGsonSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitGsonSpiceService.java | Apache-2.0 |
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
CacheManager cacheManager = new CacheManager();
cacheManager.addPersister(new RetrofitObjectPersisterFactory(application, getConverter(), getCacheFolder()));
return cacheManager;
} | A pre-set, easy to use, retrofit service. It will use retrofit for network
requests and both networking and caching will use Jackson. To use it, just add
to your manifest :
<pre>
<service
android:name="com.octo.android.robospice.retrofit.RetrofitJacksonSpiceService"
android:exported="false" />
</pre>
@author... | createCacheManager | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitJackson2SpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitJackson2SpiceService.java | Apache-2.0 |
@Override
protected Converter createConverter() {
return new JacksonConverter(new ObjectMapper());
} | A pre-set, easy to use, retrofit service. It will use retrofit for network
requests and both networking and caching will use Jackson. To use it, just add
to your manifest :
<pre>
<service
android:name="com.octo.android.robospice.retrofit.RetrofitJacksonSpiceService"
android:exported="false" />
</pre>
@author... | createConverter | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitJackson2SpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitJackson2SpiceService.java | Apache-2.0 |
public File getCacheFolder() {
return null;
} | A pre-set, easy to use, retrofit service. It will use retrofit for network
requests and both networking and caching will use Jackson. To use it, just add
to your manifest :
<pre>
<service
android:name="com.octo.android.robospice.retrofit.RetrofitJacksonSpiceService"
android:exported="false" />
</pre>
@author... | getCacheFolder | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitJackson2SpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit/src/main/java/com/octo/android/robospice/retrofit/RetrofitJackson2SpiceService.java | Apache-2.0 |
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("id=").append(id);
sb.append(", ").append("string=").append(string);
sb.append(", ").append("millis=").append(millis);
SimpleDateFormat dateFormatter = new SimpleDateFormat("MM/dd/yyyy HH:m... | A simple demonstration object we are creating and persisting to the database. | toString | java | stephanenicolas/robospice | extensions/robospice-retrofit-parent/robospice-retrofit-test/src/main/java/com/octo/android/robospice/retrofit/test/model/SimpleData.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-retrofit-parent/robospice-retrofit-test/src/main/java/com/octo/android/robospice/retrofit/test/model/SimpleData.java | Apache-2.0 |
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
CacheManager cacheManager = new CacheManager();
cacheManager.addPersister(new GsonObjectPersisterFactory(application));
return cacheManager;
} | A {@link SpringAndroidSpiceService} dedicated to json web services via gson.
Provides caching.
@author sni | createCacheManager | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/GsonSpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/GsonSpringAndroidSpiceService.java | Apache-2.0 |
@Override
public RestTemplate createRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
// web services support json responses
GsonHttpMessageConverter jsonConverter = new GsonHttpMessageConverter();
final List<HttpMessageConverter<?>> listHttpMessageConverters = restTe... | A {@link SpringAndroidSpiceService} dedicated to json web services via gson.
Provides caching.
@author sni | createRestTemplate | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/GsonSpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/GsonSpringAndroidSpiceService.java | Apache-2.0 |
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
CacheManager cacheManager = new CacheManager();
cacheManager.addPersister(new Jackson2ObjectPersisterFactory(application));
return cacheManager;
} | A {@link SpringAndroidSpiceService} dedicated to json web services via
Jackson. Provides caching.
@author sni | createCacheManager | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/Jackson2SpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/Jackson2SpringAndroidSpiceService.java | Apache-2.0 |
@Override
public RestTemplate createRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
// web services support json responses
MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter();
final List<HttpMessageConverter<?>> listHttpMess... | A {@link SpringAndroidSpiceService} dedicated to json web services via
Jackson. Provides caching.
@author sni | createRestTemplate | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/Jackson2SpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/Jackson2SpringAndroidSpiceService.java | Apache-2.0 |
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
CacheManager cacheManager = new CacheManager();
cacheManager.addPersister(new JacksonObjectPersisterFactory(application));
return cacheManager;
} | A {@link SpringAndroidSpiceService} dedicated to json web services via
Jackson. Provides caching.
@author sni | createCacheManager | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/JacksonSpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/JacksonSpringAndroidSpiceService.java | Apache-2.0 |
@Override
public RestTemplate createRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
// web services support json responses
MappingJacksonHttpMessageConverter jsonConverter = new MappingJacksonHttpMessageConverter();
final List<HttpMessageConverter<?>> listHttpMessag... | A {@link SpringAndroidSpiceService} dedicated to json web services via
Jackson. Provides caching.
@author sni | createRestTemplate | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/JacksonSpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/JacksonSpringAndroidSpiceService.java | Apache-2.0 |
@Override
public void onCreate() {
super.onCreate();
restTemplate = createRestTemplate();
} | This class offers a {@link SpiceService} that injects a {@link RestTemplate}
from spring android into every {@link SpringAndroidSpiceRequest} it has to
execute. Developpers will have to implement {@link #createRestTemplate()} in
addition to the usual {@link #createCacheManager(android.app.Application)}
methods to creat... | onCreate | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/SpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/SpringAndroidSpiceService.java | Apache-2.0 |
@Override
public void addRequest(CachedSpiceRequest<?> request, Set<RequestListener<?>> listRequestListener) {
if (request.getSpiceRequest() instanceof SpringAndroidSpiceRequest) {
((SpringAndroidSpiceRequest<?>) request.getSpiceRequest()).setRestTemplate(restTemplate);
}
super.a... | This class offers a {@link SpiceService} that injects a {@link RestTemplate}
from spring android into every {@link SpringAndroidSpiceRequest} it has to
execute. Developpers will have to implement {@link #createRestTemplate()} in
addition to the usual {@link #createCacheManager(android.app.Application)}
methods to creat... | addRequest | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/SpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/SpringAndroidSpiceService.java | Apache-2.0 |
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
CacheManager cacheManager = new CacheManager();
cacheManager.addPersister(new SimpleSerializerObjectPersisterFactory(application));
return cacheManager;
} | A {@link SpringAndroidSpiceService} dedicated to xml web services. Provides
caching.
@author sni | createCacheManager | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/XmlSpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/XmlSpringAndroidSpiceService.java | Apache-2.0 |
@Override
public RestTemplate createRestTemplate() {
RestTemplate restTemplate = new RestTemplate();
// web services support xml responses
SimpleXmlHttpMessageConverter jsonConverter = new SimpleXmlHttpMessageConverter();
final List<HttpMessageConverter<?>> listHttpMessageConverters... | A {@link SpringAndroidSpiceService} dedicated to xml web services. Provides
caching.
@author sni | createRestTemplate | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/XmlSpringAndroidSpiceService.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android/src/main/java/com/octo/android/robospice/XmlSpringAndroidSpiceService.java | Apache-2.0 |
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("id=").append(id);
sb.append(", ").append("string=").append(string);
sb.append(", ").append("millis=").append(millis);
SimpleDateFormat dateFormatter = new SimpleDateFormat(
"MM... | A simple demonstration object we are creating and persisting to the database. | toString | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android-test/src/main/java/com/octo/android/robospice/springandroid/test/model/json/SimpleData.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android-test/src/main/java/com/octo/android/robospice/springandroid/test/model/json/SimpleData.java | Apache-2.0 |
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("id=").append(id);
sb.append(", ").append("string=").append(string);
sb.append(", ").append("millis=").append(millis);
SimpleDateFormat dateFormatter = new SimpleDateFormat(
"MM... | A simple demonstration object we are creating and persisting to the database. | toString | java | stephanenicolas/robospice | extensions/robospice-spring-android-parent/robospice-spring-android-test/src/main/java/com/octo/android/robospice/springandroid/test/model/xml/SimpleData.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-spring-android-parent/robospice-spring-android-test/src/main/java/com/octo/android/robospice/springandroid/test/model/xml/SimpleData.java | Apache-2.0 |
protected final void updateListItemViewAsynchronously(final T data, final SpiceListItemView<T> spiceListItemView) {
if (!registered(spiceListItemView)) {
addSpiceListItemView(spiceListItemView);
freshDrawableSet.add(data);
}
for (int imageIndex = 0; imageIndex < spiceList... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | updateListItemViewAsynchronously | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
@SuppressWarnings("unchecked")
@Override
public View getView(final int position, final View convertView, final ViewGroup parent) {
SpiceListItemView<T> spiceListItemView;
T currentItem = getItem(position);
if (convertView != null) {
spiceListItemView = (SpiceListItemView<T>)... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | getView | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
public final void performBitmapRequestAsync(final SpiceListItemView<T> spiceListItemView, final T data, final int imageIndex) {
new ThumbnailAsynTask(createRequest(data, imageIndex, imageWidth, imageHeight)).execute(data, spiceListItemView, imageIndex);
} | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | performBitmapRequestAsync | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
private void addSpiceListItemView(final SpiceListItemView<T> spiceListItemView) {
this.networkFetchingAuthorizationStateChangeListenerList.add(new NetworkFetchingAuthorizationStateChangeAdapter(spiceListItemView));
} | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | addSpiceListItemView | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
private boolean registered(final SpiceListItemView<T> view) {
for (NetworkFetchingAuthorizationStateChangeAdapter listener : networkFetchingAuthorizationStateChangeListenerList) {
if (listener.getView() == view) {
return true;
}
}
return false;
} | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | registered | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
private void fireOnNetworkFetchingAllowedChange() {
synchronized (networkFetchingAuthorizationStateChangeListenerList) {
for (NetworkFetchingAuthorizationStateChangeAdapter networkFetchingAuthorizationStateChangeListener : networkFetchingAuthorizationStateChangeListenerList) {
Ln.d("... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | fireOnNetworkFetchingAllowedChange | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
private void initialize(final Context context, final SpiceManager spiceManagerBinary) {
this.spiceManagerBinary = spiceManagerBinary;
defaultDrawable = context.getResources().getDrawable(android.R.drawable.picture_frame);
} | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | initialize | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
@Override
public final void onRequestFailure(final SpiceException spiceException) {
Ln.e(SpiceListItemView.class.getName(), "Unable to retrive image", spiceException);
thumbImageView.setImageDrawable(defaultDrawable);
} | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | onRequestFailure | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
@Override
public final void onRequestSuccess(final Bitmap bitmap) {
freshDrawableSet.add(data);
if (this.data.equals(spiceListItemView.getData())) {
loadBitmapAsynchronously(data, thumbImageView, imageFileName);
}
} | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | onRequestSuccess | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
protected void loadBitmapAsynchronously(final T octo, final ImageView thumbImageView, final String tempThumbnailImageFileName) {
if (thumbImageView.getTag() != null && thumbImageView.getTag().equals(tempThumbnailImageFileName)) {
return;
}
if (cancelPotentialWork(tempThumbnailImageF... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | loadBitmapAsynchronously | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
private boolean cancelPotentialWork(final String fileName, final ImageView imageView) {
final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
if (bitmapWorkerTask != null) {
final String bitmapFileName = bitmapWorkerTask.fileName;
if (bitmapFileName == null |... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | cancelPotentialWork | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
protected final BitmapWorkerTask getBitmapWorkerTask(final ImageView imageView) {
if (imageView != null) {
final Drawable drawable = imageView.getDrawable();
if (drawable instanceof BaseSpiceArrayAdapter.AsyncDrawable) {
@SuppressWarnings("unchecked")
fina... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | getBitmapWorkerTask | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
@SuppressWarnings("unchecked")
@Override
protected final Boolean doInBackground(final Object... params) {
data = (T) params[0];
spiceListItemView = (SpiceListItemView<T>) params[1];
imageIndex = (Integer) params[2];
if (bitmapRequest != null) {
... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | doInBackground | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
@Override
protected final void onPostExecute(final Boolean isImageAvailableInCache) {
if (isImageAvailableInCache) {
loadBitmapAsynchronously(data, spiceListItemView.getImageView(imageIndex), tempThumbnailImageFileName);
} else {
spiceListItemView.getImage... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | onPostExecute | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
@Override
protected Drawable doInBackground(final String... params) {
fileName = params[0];
return new BitmapDrawable(getContext().getResources(), BitmapFactory.decodeFile(fileName, null));
} | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | doInBackground | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
@Override
protected void onPostExecute(Drawable drawable) {
if (isCancelled()) {
drawable = null;
}
if (imageViewReference != null && drawable != null) {
final ImageView imageView = imageViewReference.get();
final BitmapWorkerT... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | onPostExecute | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
public void onNetworkFetchingAllowedChange(final boolean networkFetchingAllowed) {
SpiceListItemView<T> spiceListItemView = weakReferenceSpiceListItemView.get();
if (spiceListItemView != null && networkFetchingAllowed) {
T data = spiceListItemView.getData();
for (... | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | onNetworkFetchingAllowedChange | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
public SpiceListItemView<T> getView() {
return weakReferenceSpiceListItemView.get();
} | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | getView | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
public BitmapWorkerTask getBitmapWorkerTask() {
return bitmapWorkerTaskReference.get();
} | Updates a {@link SpiceListItemView} containing some data. The method
{@link #createRequest(Object)} will be applied to data to know which bitmapRequest to execute
to get data from network if needed. This method must be called during
{@link #getView(int, android.view.View, android.view.ViewGroup)}.
@param data
... | getBitmapWorkerTask | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/BaseSpiceArrayAdapter.java | Apache-2.0 |
@Override
public void setOnScrollListener(OnScrollListener l) {
onScrollListener.setWrappedListener(l);
super.setOnScrollListener(onScrollListener);
} | {@inheritDoc}
@param l The listener to register with the ListView, or {@code null} to unregister an existing one. | setOnScrollListener | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | Apache-2.0 |
@Override
public void setAdapter(ListAdapter adapter) {
if (!(adapter instanceof BaseSpiceArrayAdapter)) {
throw new IllegalArgumentException("SpiceLists only support SpiceArrayAdapters.");
}
super.setAdapter(adapter);
} | {@inheritDoc}
@param l The listener to register with the ListView, or {@code null} to unregister an existing one. | setAdapter | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | Apache-2.0 |
@Override
public BaseSpiceArrayAdapter<?> getAdapter() {
ListAdapter adapter = super.getAdapter();
if (adapter == null) {
return null;
} else if (adapter instanceof BaseSpiceArrayAdapter<?>) {
return (BaseSpiceArrayAdapter<?>) adapter;
} else {
r... | {@inheritDoc}
@param l The listener to register with the ListView, or {@code null} to unregister an existing one. | getAdapter | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | Apache-2.0 |
private void setWrappedListener(OnScrollListener l) {
this.wrappedListener = l;
} | {@inheritDoc}
@param l The listener to register with the ListView, or {@code null} to unregister an existing one. | setWrappedListener | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | Apache-2.0 |
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (getAdapter() != null) {
getAdapter().setNetworkFetchingAllowed(scrollState == SCROLL_STATE_IDLE);
}
if (wrappedListener != null) {
wrappedListener.onScrollState... | {@inheritDoc}
@param l The listener to register with the ListView, or {@code null} to unregister an existing one. | onScrollStateChanged | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | Apache-2.0 |
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (wrappedListener != null) {
wrappedListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
}
} | {@inheritDoc}
@param l The listener to register with the ListView, or {@code null} to unregister an existing one. | onScroll | java | stephanenicolas/robospice | extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | https://github.com/stephanenicolas/robospice/blob/master/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java | Apache-2.0 |
public Application getApplication() {
return application;
} | Super class of all entities responsible for loading/saving objects of a given
class in the cache.
@author sni
@param <T>
the class of the objects this {@link ObjectPersister} can
persist/unpersist. | getApplication | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | Apache-2.0 |
public Class<T> getHandledClass() {
return clazz;
} | Super class of all entities responsible for loading/saving objects of a given
class in the cache.
@author sni
@param <T>
the class of the objects this {@link ObjectPersister} can
persist/unpersist. | getHandledClass | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | Apache-2.0 |
@Override
public boolean canHandleClass(Class<?> clazz) {
return clazz.equals(this.clazz);
} | Super class of all entities responsible for loading/saving objects of a given
class in the cache.
@author sni
@param <T>
the class of the objects this {@link ObjectPersister} can
persist/unpersist. | canHandleClass | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | Apache-2.0 |
public boolean isAsyncSaveEnabled() {
return isAsyncSaveEnabled;
} | Return the creation date of creation of cache. entry for a given
cacheKey.
@param cacheKey
the cachekey identifying the object to look for.
@return a long corresponding to the creation date of creation of cache.
@throws CacheLoadingException
if there is no such element in cache. | isAsyncSaveEnabled | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | Apache-2.0 |
public void setAsyncSaveEnabled(boolean isAsyncSaveEnabled) {
this.isAsyncSaveEnabled = isAsyncSaveEnabled;
} | Return the creation date of creation of cache. entry for a given
cacheKey.
@param cacheKey
the cachekey identifying the object to look for.
@return a long corresponding to the creation date of creation of cache.
@throws CacheLoadingException
if there is no such element in cache. | setAsyncSaveEnabled | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersister.java | Apache-2.0 |
protected final Application getApplication() {
return mApplication;
} | Creates an {@link ObjectPersisterFactory} given an Android application
and a list of handled classes.
@param application
the android context needed to access android file system or
databases to store.
@param listHandledClasses
the list of classes that is handled by the factory. The
... | getApplication | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | Apache-2.0 |
@Override
public boolean canHandleClass(Class<?> clazz) {
if (listHandledClasses == null) {
return true;
} else {
return listHandledClasses.contains(clazz);
}
} | Wether or not this bus element can persist/unpersist objects of the given
class clazz.
@param clazz
the class of objets we are looking forward to persist.
@return true if this bus element can persist/unpersist objects of the
given class clazz. False otherwise. | canHandleClass | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | Apache-2.0 |
public void setAsyncSaveEnabled(boolean isAsyncSaveEnabled) {
this.isAsyncSaveEnabled = isAsyncSaveEnabled;
} | Set whether this {@link ObjectPersisterFactory} will set the
{@link ObjectPersister} instances it produces to save data asynchronously
or not.
@param isAsyncSaveEnabled
whether or not data will be saved asynchronously by
{@link ObjectPersister} instances produced by this factory. | setAsyncSaveEnabled | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | Apache-2.0 |
public boolean isAsyncSaveEnabled() {
return isAsyncSaveEnabled;
} | Indicates whether this {@link ObjectPersisterFactory} will set the
{@link ObjectPersister} instances it produces to save data asynchronously
or not.
@return true if the {@link ObjectPersister} instances it produces to save
data asynchronously. False otherwise. | isAsyncSaveEnabled | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | Apache-2.0 |
protected List<Class<?>> getListHandledClasses() {
return listHandledClasses;
} | Return the list of classes persisted by this factory.
@return the list of classes persisted by this factory. | getListHandledClasses | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/ObjectPersisterFactory.java | Apache-2.0 |
@Override
public InputStream saveDataToCacheAndReturnData(InputStream data, Object cacheKey) throws CacheSavingException {
FileOutputStream output = null;
// special case for big inputstream object : as it can be read
// only once and is too big to be locally
// duplicated,
/... | Stores / retrieves data in file system. This {@link ObjectPersister} is
optimized for memory. It will only use file system to save the data, without
allocating large memory space to transfert a given binary to the cache. It
should be preferred to {@link InFileInputStreamObjectPersister} for low
memory devices or memory... | saveDataToCacheAndReturnData | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBigInputStreamObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBigInputStreamObjectPersister.java | Apache-2.0 |
@Override
public void setAsyncSaveEnabled(boolean isAsyncSaveEnabled) {
if (isAsyncSaveEnabled) {
throw new IllegalStateException("Asynchronous saving operation not supported.");
}
} | Stores / retrieves data in file system. This {@link ObjectPersister} is
optimized for memory. It will only use file system to save the data, without
allocating large memory space to transfert a given binary to the cache. It
should be preferred to {@link InFileInputStreamObjectPersister} for low
memory devices or memory... | setAsyncSaveEnabled | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBigInputStreamObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBigInputStreamObjectPersister.java | Apache-2.0 |
@Override
protected Bitmap readCacheDataFromFile(File file) throws CacheLoadingException {
Bitmap data;
FileInputStream is = null;
try {
is = new FileInputStream(file.getAbsolutePath());
data = BitmapFactory.decodeStream(is, null, decodingOptions);
} catch (Th... | Stores and retrieves bitmaps to/from file system. Support custom
{@link android.graphics.BitmapFactory.Options} to lower disk usage.
@author David Stemmer | readCacheDataFromFile | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | Apache-2.0 |
@Override
public Bitmap saveDataToCacheAndReturnData(Bitmap data, Object cacheKey) throws CacheSavingException {
BufferedOutputStream out = null;
try {
File cacheFile = getCacheFile(cacheKey);
out = new BufferedOutputStream(new FileOutputStream(cacheFile));
bool... | Stores and retrieves bitmaps to/from file system. Support custom
{@link android.graphics.BitmapFactory.Options} to lower disk usage.
@author David Stemmer | saveDataToCacheAndReturnData | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | Apache-2.0 |
public BitmapFactory.Options getDecodingOptions() {
return decodingOptions;
} | Stores and retrieves bitmaps to/from file system. Support custom
{@link android.graphics.BitmapFactory.Options} to lower disk usage.
@author David Stemmer | getDecodingOptions | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | Apache-2.0 |
public void setDecodingOptions(BitmapFactory.Options decodingOptions) {
this.decodingOptions = decodingOptions;
} | Stores and retrieves bitmaps to/from file system. Support custom
{@link android.graphics.BitmapFactory.Options} to lower disk usage.
@author David Stemmer | setDecodingOptions | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | Apache-2.0 |
public Bitmap.CompressFormat getCompressFormat() {
return compressFormat;
} | Stores and retrieves bitmaps to/from file system. Support custom
{@link android.graphics.BitmapFactory.Options} to lower disk usage.
@author David Stemmer | getCompressFormat | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | Apache-2.0 |
public void setCompressFormat(Bitmap.CompressFormat compressFormat) {
this.compressFormat = compressFormat;
} | Stores and retrieves bitmaps to/from file system. Support custom
{@link android.graphics.BitmapFactory.Options} to lower disk usage.
@author David Stemmer | setCompressFormat | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | Apache-2.0 |
public int getQuality() {
return quality;
} | Stores and retrieves bitmaps to/from file system. Support custom
{@link android.graphics.BitmapFactory.Options} to lower disk usage.
@author David Stemmer | getQuality | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | Apache-2.0 |
public void setQuality(int quality) {
this.quality = quality;
} | Stores and retrieves bitmaps to/from file system. Support custom
{@link android.graphics.BitmapFactory.Options} to lower disk usage.
@author David Stemmer | setQuality | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/binary/InFileBitmapObjectPersister.java | Apache-2.0 |
public void setCacheFolder(File cacheFolder) throws CacheCreationException {
if (cacheFolder == null) {
cacheFolder = new File(getApplication().getCacheDir(), DEFAULT_ROOT_CACHE_DIR);
}
synchronized (cacheFolder.getAbsolutePath().intern()) {
if (!cacheFolder.exists() && !... | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | setCacheFolder | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
public final File getCacheFolder() {
return cacheFolder;
} | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | getCacheFolder | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
@Override
public long getCreationDateInCache(Object cacheKey) throws CacheLoadingException {
File cacheFile = getCacheFile(cacheKey);
if (cacheFile.exists()) {
return cacheFile.lastModified();
} else {
throw new CacheLoadingException(
"Data could not b... | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | getCreationDateInCache | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
@Override
public List<Object> getAllCacheKeys() {
final String prefix = getCachePrefix();
int prefixLength = prefix.length();
String[] cacheFileNameList = getCacheFolder().list(new FilenameFilter() {
@Override
public boolean accept(File dir, String filename) {
... | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | getAllCacheKeys | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
@Override
public boolean accept(File dir, String filename) {
// patch from florianmski
return filename.startsWith(prefix);
} | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | accept | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
@Override
public List<T> loadAllDataFromCache() throws CacheLoadingException {
List<Object> allCacheKeys = getAllCacheKeys();
List<T> result = new ArrayList<T>(allCacheKeys.size());
for (Object key : allCacheKeys) {
result.add(loadDataFromCache(key, DurationInMillis.ALWAYS_RETURN... | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | loadAllDataFromCache | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
@Override
public boolean removeDataFromCache(Object cacheKey) {
return getCacheFile(cacheKey).delete();
} | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | removeDataFromCache | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
@Override
public void removeAllDataFromCache() {
File cacheFolder = getCacheFolder();
File[] cacheFileList = cacheFolder.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.getName().startsWith(getCachePrefix());
... | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | removeAllDataFromCache | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
@Override
public boolean accept(File file) {
return file.getName().startsWith(getCachePrefix());
} | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | accept | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
@Override
public T loadDataFromCache(Object cacheKey, long maxTimeInCache) throws CacheLoadingException {
File file = getCacheFile(cacheKey);
if (isCachedAndNotExpired(file, maxTimeInCache)) {
return readCacheDataFromFile(file);
}
return null;
} | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | loadDataFromCache | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
@Override
public boolean isDataInCache(Object cacheKey, long maxTimeInCacheBeforeExpiry) {
File file = getCacheFile(cacheKey);
return isCachedAndNotExpired(file, maxTimeInCacheBeforeExpiry);
} | Set the cacheFolder to use.
@param cacheFolder
the new cache folder to use. Can be null, will then default to
{@link #DEFAULT_ROOT_CACHE_DIR} sub folder in the application
cache dir.
@throws CacheCreationException
if the cache folder doesn't exist or can't be created. | isDataInCache | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
public boolean isUsingKeySanitizer() {
return keySanitizer != null;
} | @return Whether or not this {@link InFileObjectPersister} uses a
{@link KeySanitizer}. | isUsingKeySanitizer | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
public void setKeySanitizer(KeySanitizer keySanitizer) {
this.keySanitizer = keySanitizer;
} | @param keySanitizer
the new key sanitizer to be used by this
{@link InFileObjectPersister}. May be null, in that case no
key sanitation will be used default). If key sanitation fails
on a given cache key (by throwing a
{@link KeySanitationExcepion}, original (unsan... | setKeySanitizer | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
public KeySanitizer getKeySanitizer() {
return keySanitizer;
} | @return the key sanitizer used by this {@link InFileObjectPersister}. May
be null, in that case no key sanitation will be used default). | getKeySanitizer | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
public final File getCacheFile(Object cacheKey) {
return new File(getCacheFolder(), getCachePrefix() + toKey(cacheKey.toString()));
} | @return the key sanitizer used by this {@link InFileObjectPersister}. May
be null, in that case no key sanitation will be used default). | getCacheFile | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
void setFactoryCachePrefix(String factoryCachePrefix) {
this.factoryCachePrefix = factoryCachePrefix;
} | @return the key sanitizer used by this {@link InFileObjectPersister}. May
be null, in that case no key sanitation will be used default). | setFactoryCachePrefix | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
protected final String toKey(String cacheKey) {
if (isUsingKeySanitizer()) {
try {
return (String) keySanitizer.sanitizeKey(cacheKey);
} catch (KeySanitationExcepion e) {
Ln.e(e, "Key could not be sanitized, falling back on original key.");
... | Get a key that may be sanitized if a {@link KeySanitizer} is used.
@param cacheKey
a non-sanitized cacheKey.
@return a key that will be sanitized if a {@link KeySanitizer} is used. | toKey | java | stephanenicolas/robospice | robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | https://github.com/stephanenicolas/robospice/blob/master/robospice-cache-parent/robospice-cache/src/main/java/com/octo/android/robospice/persistence/file/InFileObjectPersister.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.