Java Code Examples for com.bumptech.glide.load.model.ModelLoaderFactory

The following are top voted examples for showing how to use com.bumptech.glide.load.model.ModelLoaderFactory. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: GitHub   File: GlideTest.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private <T, Z> void registerFailFactory(Class<T> failModel, Class<Z> failResource)
    throws Exception {
  DataFetcher<Z> failFetcher = mock(DataFetcher.class);
  doAnswer(new Util.CallDataReady<>(null))
      .when(failFetcher)
      .loadData(isA(Priority.class), isA(DataFetcher.DataCallback.class));
  when(failFetcher.getDataClass()).thenReturn(failResource);
  ModelLoader<T, Z> failLoader = mock(ModelLoader.class);
  when(failLoader.buildLoadData(isA(failModel), anyInt(), anyInt(), isA(Options.class)))
      .thenReturn(new ModelLoader.LoadData<>(mock(Key.class), failFetcher));
  when(failLoader.handles(isA(failModel))).thenReturn(true);
  ModelLoaderFactory<T, Z> failFactory = mock(ModelLoaderFactory.class);
  when(failFactory.build(isA(MultiModelLoaderFactory.class))).thenReturn(failLoader);

  Glide.get(getContext()).getRegistry().prepend(failModel, failResource, failFactory);
}
 
Example 2
Project: GitHub   File: GlideTest.java   View source code 6 votes vote down vote up
private static <X, Y> void registerMockModelLoader(Class<X> modelClass, Class<Y> dataClass,
      Y loadedData, Registry registry) {
  DataFetcher<Y> mockStreamFetcher = mock(DataFetcher.class);
  when(mockStreamFetcher.getDataClass()).thenReturn(dataClass);
  try {
    doAnswer(new Util.CallDataReady<>(loadedData))
        .when(mockStreamFetcher)
        .loadData(isA(Priority.class), isA(DataFetcher.DataCallback.class));
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  ModelLoader<X, Y> mockUrlLoader = mock(ModelLoader.class);
  when(mockUrlLoader.buildLoadData(isA(modelClass), anyInt(), anyInt(), isA(Options.class)))
      .thenReturn(new ModelLoader.LoadData<>(mock(Key.class), mockStreamFetcher));
  when(mockUrlLoader.handles(isA(modelClass))).thenReturn(true);
  ModelLoaderFactory<X, Y> mockUrlLoaderFactory = mock(ModelLoaderFactory.class);
  when(mockUrlLoaderFactory.build(isA(MultiModelLoaderFactory.class)))
      .thenReturn(mockUrlLoader);

  registry.replace(modelClass, dataClass, mockUrlLoaderFactory);
}
 
Example 3
Project: GitHub   File: GlideTest.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private <T, Z> void registerFailFactory(Class<T> failModel, Class<Z> failResource) {
  DataFetcher<Z> failFetcher = mock(DataFetcher.class);
  doAnswer(new Util.CallDataReady<>(null))
      .when(failFetcher)
      .loadData(isA(Priority.class), isA(DataFetcher.DataCallback.class));
  when(failFetcher.getDataClass()).thenReturn(failResource);
  ModelLoader<T, Z> failLoader = mock(ModelLoader.class);
  when(failLoader.buildLoadData(isA(failModel), anyInt(), anyInt(), isA(Options.class)))
      .thenReturn(new ModelLoader.LoadData<>(mock(Key.class), failFetcher));
  when(failLoader.handles(isA(failModel))).thenReturn(true);
  ModelLoaderFactory<T, Z> failFactory = mock(ModelLoaderFactory.class);
  when(failFactory.build(isA(MultiModelLoaderFactory.class))).thenReturn(failLoader);

  Glide.get(context).getRegistry().prepend(failModel, failResource, failFactory);
}
 
Example 4
Project: GitHub   File: GlideTest.java   View source code 6 votes vote down vote up
private static <X, Y> void registerMockModelLoader(Class<X> modelClass, Class<Y> dataClass,
      Y loadedData, Registry registry) {
  DataFetcher<Y> mockStreamFetcher = mock(DataFetcher.class);
  when(mockStreamFetcher.getDataClass()).thenReturn(dataClass);
  try {
    doAnswer(new Util.CallDataReady<>(loadedData))
        .when(mockStreamFetcher)
        .loadData(isA(Priority.class), isA(DataFetcher.DataCallback.class));
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  ModelLoader<X, Y> mockUrlLoader = mock(ModelLoader.class);
  when(mockUrlLoader.buildLoadData(isA(modelClass), anyInt(), anyInt(), isA(Options.class)))
      .thenReturn(new ModelLoader.LoadData<>(mock(Key.class), mockStreamFetcher));
  when(mockUrlLoader.handles(isA(modelClass))).thenReturn(true);
  ModelLoaderFactory<X, Y> mockUrlLoaderFactory = mock(ModelLoaderFactory.class);
  when(mockUrlLoaderFactory.build(isA(MultiModelLoaderFactory.class)))
      .thenReturn(mockUrlLoader);

  registry.replace(modelClass, dataClass, mockUrlLoaderFactory);
}
 
Example 5
Project: GitHub   File: GlideTest.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked")
private <T> void registerMockStreamModelLoader(final Class<T> modelClass) {
  ModelLoader<T, InputStream> modelLoader = mockStreamModelLoader(modelClass);
  ModelLoaderFactory<T, InputStream> modelLoaderFactory = mock(ModelLoaderFactory.class);
  when(modelLoaderFactory.build(isA(MultiModelLoaderFactory.class))).thenReturn(modelLoader);

  Glide.get(RuntimeEnvironment.application).getRegistry()
      .prepend(modelClass, InputStream.class, modelLoaderFactory);
}
 
Example 6
Project: GitHub   File: WaitModelLoader.java   View source code 5 votes vote down vote up
public static synchronized <T> WaitModel<T> waitOn(T model) {
  @SuppressWarnings("unchecked") ModelLoaderFactory<WaitModel<T>, InputStream> streamFactory =
      new Factory<>((Class<T>) model.getClass(), InputStream.class);
  Glide.get(InstrumentationRegistry.getTargetContext())
      .getRegistry()
      .replace(WaitModel.class, InputStream.class, streamFactory);

  return new WaitModel<>(model);
}
 
Example 7
Project: GitHub   File: GlideTest.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked")
private <T> void registerMockStreamModelLoader(final Class<T> modelClass) {
  ModelLoader<T, InputStream> modelLoader = mockStreamModelLoader(modelClass);
  ModelLoaderFactory<T, InputStream> modelLoaderFactory = mock(ModelLoaderFactory.class);
  when(modelLoaderFactory.build(isA(MultiModelLoaderFactory.class))).thenReturn(modelLoader);

  Glide.get(context).getRegistry()
      .prepend(modelClass, InputStream.class, modelLoaderFactory);
}
 
Example 8
Project: TWiStErRob   File: MainActivity.java   View source code 5 votes vote down vote up
@Override
protected void onResume() {
    super.onResume();

    FileDescriptorUriLoader.Factory originalFactory = new FileDescriptorUriLoader.Factory();
    ModelLoaderFactory<Uri, ParcelFileDescriptor> wrapperFactory = new ModelLoaderFactoryWrapper<>(originalFactory, this);
    Glide.get(this).register(Uri.class, ParcelFileDescriptor.class, wrapperFactory);
}
 
Example 9
Project: GitHub   File: Registry.java   View source code 4 votes vote down vote up
public <Model, Data> Registry prepend(Class<Model> modelClass, Class<Data> dataClass,
    ModelLoaderFactory<Model, Data> factory) {
  modelLoaderRegistry.prepend(modelClass, dataClass, factory);
  return this;
}
 
Example 10
Project: GitHub   File: Registry.java   View source code 4 votes vote down vote up
public <Model, Data> Registry replace(Class<Model> modelClass, Class<Data> dataClass,
    ModelLoaderFactory<Model, Data> factory) {
  modelLoaderRegistry.replace(modelClass, dataClass, factory);
  return this;
}
 
Example 11
Project: RecyclerAdapterBase   File: GlideVolleyRequestExecutor.java   View source code 4 votes vote down vote up
@Override
public ModelLoaderFactory<GlideUrl, InputStream> createUrlLoaderFactory() {
	return new VolleyUrlLoader.Factory(getRequestQueue());
}
 
Example 12
Project: RecyclerAdapterBase   File: ExampleApiBase.java   View source code 4 votes vote down vote up
public static ModelLoaderFactory<GlideUrl, InputStream> createUrlLoaderFactory() {
	if(sExecutor instanceof GlideLoaderFactory) {
		return ((GlideLoaderFactory)sExecutor).createUrlLoaderFactory();
	}
	return null;
}
 
Example 13
Project: glide-support   File: GlideModule.java   View source code 4 votes vote down vote up
/**
 * {@link Glide#register(Class, Class, ModelLoaderFactory) Register}'s params should be
 * {@code (Class<T>, Class<Y>, ModelLoaderFactory<? super T, Y>)}. This method works around that.
 */
@SuppressWarnings({"unchecked", "unused"})
private static <T> ModelLoaderFactory<T, InputStream> superFactory(
		ModelLoaderFactory<? super T, InputStream> factory, Class<T> modelType) {
	return (ModelLoaderFactory<T, InputStream>)factory;
}
 
Example 14
Project: toshi-android-client   File: GlideOkHttpStack.java   View source code 4 votes vote down vote up
/**
 * {@link Glide#register(Class, Class, ModelLoaderFactory) Register}'s params should be
 * {@code (Class<T>, Class<Y>, ModelLoaderFactory<? super T, Y>)}. This method works around that.
 */
@SuppressWarnings({"unchecked", "unused"})
private static <T> ModelLoaderFactory<T, InputStream> superFactory(
        ModelLoaderFactory<? super T, InputStream> factory, Class<T> modelType) {
    return (ModelLoaderFactory<T, InputStream>)factory;
}
 
Example 15
Project: TWiStErRob   File: ModelLoaderFactoryWrapper.java   View source code 4 votes vote down vote up
public ModelLoaderFactoryWrapper(ModelLoaderFactory<T, Y> wrapped, ExceptionHandler handler) {
    this.wrapped = wrapped;
    this.handler = handler;
}
 
Example 16
Project: GitHub   File: Registry.java   View source code 3 votes vote down vote up
/**
 * Removes all default and previously registered {@link ModelLoaderFactory}s for the given data
 * and model class and replaces all of them with the single {@link ModelLoader} provided.
 *
 * <p>If you're attempting to add additional functionality or add a backup that should run only
 * after the default {@link ModelLoader}s run, use
 * {@link #append(Class, Class, ModelLoaderFactory)}. This method should be used only when you
 * want to ensure that Glide's default {@link ModelLoader}s do not run.
 *
 * <p>One good use case for this method is when you want to replace Glide's default networking
 * library with your OkHttp, Volley, or your own implementation. Using
 * {@link #prepend(Class, Class, ModelLoaderFactory)} or
 * {@link #append(Class, Class, ModelLoaderFactory)} may still allow Glide's default networking
 * library to run in some cases. Using this method will ensure that only your networking library
 * will run and that the request will fail otherwise.
 *
 * @see #prepend(Class, Class, ModelLoaderFactory)
 * @see #append(Class, Class, ModelLoaderFactory)
 *
 * @param modelClass The model class (e.g. URL, file path).
 * @param dataClass  the data class (e.g. {@link java.io.InputStream},
 * {@link java.io.FileDescriptor}).
 */
public <Model, Data> Registry replace(
    Class<Model> modelClass,
    Class<Data> dataClass,
    ModelLoaderFactory<? extends Model, ? extends Data> factory) {
  modelLoaderRegistry.replace(modelClass, dataClass, factory);
  return this;
}
 
Example 17
Project: saarang-iosched   File: Glide.java   View source code 3 votes vote down vote up
/**
 * Use the given factory to build a {@link ModelLoader} for models of the given class. Generally the best use of
 * this method is to replace one of the default factories or add an implementation for other similar low level
 * models. Typically the {@link ModelRequest#using(StreamModelLoader)} or
 * {@link ModelRequest#using(FileDescriptorModelLoader)} syntax is preferred because it directly links the model
 * with the ModelLoader being used to load it. Any factory replaced by the given factory will have its
 * {@link ModelLoaderFactory#teardown()}} method called.
 *
 * <p>
 *     Note - If a factory already exists for the given class, it will be replaced. If that factory is not being
 *     used for any other model class, {@link ModelLoaderFactory#teardown()}
 *     will be called.
 * </p>
 *
 * <p>
 *     Note - The factory must not be an anonymous inner class of an Activity or another object that cannot be
 *     retained statically.
 * </p>
 *
 * @see ModelRequest#using(FileDescriptorModelLoader)
 * @see ModelRequest#using(StreamModelLoader)
 *
 * @param modelClass The model class.
 * @param resourceClass The resource class the model loader will translate the model type into.
 * @param factory The factory to use.
 * @param <T> The type of the model.
 * @param <Y> the type of the resource.
 */
public <T, Y> void register(Class<T> modelClass, Class<Y> resourceClass, ModelLoaderFactory<T, Y> factory) {
    ModelLoaderFactory<T, Y> removed = loaderFactory.register(modelClass, resourceClass, factory);
    if (removed != null) {
        removed.teardown();
    }
}
 
Example 18
Project: saarang-iosched   File: Glide.java   View source code 3 votes vote down vote up
/**
 * Removes any {@link ModelLoaderFactory} registered for the given model and resource classes if one exists. If a
 * {@link ModelLoaderFactory} is removed, its {@link ModelLoaderFactory#teardown()}} method will be called.
 *
 * @param modelClass The model class.
 * @param resourceClass The resource class.
 * @param <T> The type of the model.
 * @param <Y> The type of the resource.
 */
public <T, Y> void unregister(Class<T> modelClass, Class<Y> resourceClass) {
    ModelLoaderFactory<T, Y> removed = loaderFactory.unregister(modelClass, resourceClass);
    if (removed != null) {
        removed.teardown();
    }
}
 
Example 19
Project: AppDevFestSudeste2015   File: Glide.java   View source code 3 votes vote down vote up
/**
 * Use the given factory to build a {@link ModelLoader} for models of the given class. Generally the best use of
 * this method is to replace one of the default factories or add an implementation for other similar low level
 * models. Typically the {@link ModelRequest#using(StreamModelLoader)} or
 * {@link ModelRequest#using(FileDescriptorModelLoader)} syntax is preferred because it directly links the model
 * with the ModelLoader being used to load it. Any factory replaced by the given factory will have its
 * {@link ModelLoaderFactory#teardown()}} method called.
 *
 * <p>
 *     Note - If a factory already exists for the given class, it will be replaced. If that factory is not being
 *     used for any other model class, {@link ModelLoaderFactory#teardown()}
 *     will be called.
 * </p>
 *
 * <p>
 *     Note - The factory must not be an anonymous inner class of an Activity or another object that cannot be
 *     retained statically.
 * </p>
 *
 * @see ModelRequest#using(FileDescriptorModelLoader)
 * @see ModelRequest#using(StreamModelLoader)
 *
 * @param modelClass The model class.
 * @param resourceClass The resource class the model loader will translate the model type into.
 * @param factory The factory to use.
 * @param <T> The type of the model.
 * @param <Y> the type of the resource.
 */
public <T, Y> void register(Class<T> modelClass, Class<Y> resourceClass, ModelLoaderFactory<T, Y> factory) {
    ModelLoaderFactory<T, Y> removed = loaderFactory.register(modelClass, resourceClass, factory);
    if (removed != null) {
        removed.teardown();
    }
}
 
Example 20
Project: AppDevFestSudeste2015   File: Glide.java   View source code 3 votes vote down vote up
/**
 * Removes any {@link ModelLoaderFactory} registered for the given model and resource classes if one exists. If a
 * {@link ModelLoaderFactory} is removed, its {@link ModelLoaderFactory#teardown()}} method will be called.
 *
 * @param modelClass The model class.
 * @param resourceClass The resource class.
 * @param <T> The type of the model.
 * @param <Y> The type of the resource.
 */
public <T, Y> void unregister(Class<T> modelClass, Class<Y> resourceClass) {
    ModelLoaderFactory<T, Y> removed = loaderFactory.unregister(modelClass, resourceClass);
    if (removed != null) {
        removed.teardown();
    }
}
 
Example 21
Project: devfestnorte-app   File: Glide.java   View source code 3 votes vote down vote up
/**
 * Use the given factory to build a {@link ModelLoader} for models of the given class. Generally the best use of
 * this method is to replace one of the default factories or add an implementation for other similar low level
 * models. Typically the {@link ModelRequest#using(StreamModelLoader)} or
 * {@link ModelRequest#using(FileDescriptorModelLoader)} syntax is preferred because it directly links the model
 * with the ModelLoader being used to load it. Any factory replaced by the given factory will have its
 * {@link ModelLoaderFactory#teardown()}} method called.
 *
 * <p>
 *     Note - If a factory already exists for the given class, it will be replaced. If that factory is not being
 *     used for any other model class, {@link ModelLoaderFactory#teardown()}
 *     will be called.
 * </p>
 *
 * <p>
 *     Note - The factory must not be an anonymous inner class of an Activity or another object that cannot be
 *     retained statically.
 * </p>
 *
 * @see ModelRequest#using(FileDescriptorModelLoader)
 * @see ModelRequest#using(StreamModelLoader)
 *
 * @param modelClass The model class.
 * @param resourceClass The resource class the model loader will translate the model type into.
 * @param factory The factory to use.
 * @param <T> The type of the model.
 * @param <Y> the type of the resource.
 */
public <T, Y> void register(Class<T> modelClass, Class<Y> resourceClass, ModelLoaderFactory<T, Y> factory) {
    ModelLoaderFactory<T, Y> removed = loaderFactory.register(modelClass, resourceClass, factory);
    if (removed != null) {
        removed.teardown();
    }
}
 
Example 22
Project: devfestnorte-app   File: Glide.java   View source code 3 votes vote down vote up
/**
 * Removes any {@link ModelLoaderFactory} registered for the given model and resource classes if one exists. If a
 * {@link ModelLoaderFactory} is removed, its {@link ModelLoaderFactory#teardown()}} method will be called.
 *
 * @param modelClass The model class.
 * @param resourceClass The resource class.
 * @param <T> The type of the model.
 * @param <Y> The type of the resource.
 */
public <T, Y> void unregister(Class<T> modelClass, Class<Y> resourceClass) {
    ModelLoaderFactory<T, Y> removed = loaderFactory.unregister(modelClass, resourceClass);
    if (removed != null) {
        removed.teardown();
    }
}
 
Example 23
Project: saarang-iosched   File: Glide.java   View source code 3 votes vote down vote up
/**
 * Use the given factory to build a {@link ModelLoader} for models of the given class. Generally the best use of
 * this method is to replace one of the default factories or add an implementation for other similar low level
 * models. Typically the {@link ModelRequest#using(StreamModelLoader)} or
 * {@link ModelRequest#using(FileDescriptorModelLoader)} syntax is preferred because it directly links the model
 * with the ModelLoader being used to load it. Any factory replaced by the given factory will have its
 * {@link ModelLoaderFactory#teardown()}} method called.
 *
 * <p>
 *     Note - If a factory already exists for the given class, it will be replaced. If that factory is not being
 *     used for any other model class, {@link ModelLoaderFactory#teardown()}
 *     will be called.
 * </p>
 *
 * <p>
 *     Note - The factory must not be an anonymous inner class of an Activity or another object that cannot be
 *     retained statically.
 * </p>
 *
 * @see ModelRequest#using(FileDescriptorModelLoader)
 * @see ModelRequest#using(StreamModelLoader)
 *
 * @param modelClass The model class.
 * @param resourceClass The resource class the model loader will translate the model type into.
 * @param factory The factory to use.
 * @param <T> The type of the model.
 * @param <Y> the type of the resource.
 */
public <T, Y> void register(Class<T> modelClass, Class<Y> resourceClass, ModelLoaderFactory<T, Y> factory) {
    ModelLoaderFactory<T, Y> removed = loaderFactory.register(modelClass, resourceClass, factory);
    if (removed != null) {
        removed.teardown();
    }
}
 
Example 24
Project: saarang-iosched   File: Glide.java   View source code 3 votes vote down vote up
/**
 * Removes any {@link ModelLoaderFactory} registered for the given model and resource classes if one exists. If a
 * {@link ModelLoaderFactory} is removed, its {@link ModelLoaderFactory#teardown()}} method will be called.
 *
 * @param modelClass The model class.
 * @param resourceClass The resource class.
 * @param <T> The type of the model.
 * @param <Y> The type of the resource.
 */
public <T, Y> void unregister(Class<T> modelClass, Class<Y> resourceClass) {
    ModelLoaderFactory<T, Y> removed = loaderFactory.unregister(modelClass, resourceClass);
    if (removed != null) {
        removed.teardown();
    }
}
 
Example 25
Project: GitHub   File: Registry.java   View source code 2 votes vote down vote up
/**
 * Use the given factory to build a {@link com.bumptech.glide.load.model.ModelLoader} for models
 * of the given class. Generally the best use of this method is to replace one of the default
 * factories or add an implementation for other similar low level models. Any factory replaced by
 * the given factory will have its {@link ModelLoaderFactory#teardown()}} method called.
 *
 * <p> Note - If a factory already exists for the given class, it will be replaced. If that
 * factory is not being used for any other model class, {@link ModelLoaderFactory#teardown()} will
 * be called. </p>
 *
 * <p> Note - The factory must not be an anonymous inner class of an Activity or another object
 * that cannot be retained statically. </p>
 *
 * @param modelClass The model class.
 * @param dataClass  the data class.
 */
public <Model, Data> Registry append(Class<Model> modelClass, Class<Data> dataClass,
    ModelLoaderFactory<Model, Data> factory) {
  modelLoaderRegistry.append(modelClass, dataClass, factory);
  return this;
}
 
Example 26
Project: GitHub   File: Registry.java   View source code 2 votes vote down vote up
/**
 * Appends a new {@link ModelLoaderFactory} onto the end of the existing set so that the
 * constructed {@link ModelLoader} will be tried after all default and previously registered
 * {@link ModelLoader}s for the given model and data classes.
 *
 * <p>If you're attempting to replace an existing {@link ModelLoader}, use
 * {@link #prepend(Class, Class, ModelLoaderFactory)}. This method is best for new types of models
 * and/or data or as a way to add an additional fallback loader for an existing type of
 * model/data.
 *
 * <p>If multiple {@link ModelLoaderFactory}s are registered for the same model and/or data
 * classes, the {@link ModelLoader}s they produce will be attempted in the order the
 * {@link ModelLoaderFactory}s were registered. Only if all {@link ModelLoader}s fail will the
 * entire request fail.
 *
 * @see #prepend(Class, Class, ModelLoaderFactory)
 * @see #replace(Class, Class, ModelLoaderFactory)
 *
 * @param modelClass The model class (e.g. URL, file path).
 * @param dataClass  the data class (e.g. {@link java.io.InputStream},
 * {@link java.io.FileDescriptor}).
 */
public <Model, Data> Registry append(Class<Model> modelClass, Class<Data> dataClass,
    ModelLoaderFactory<Model, Data> factory) {
  modelLoaderRegistry.append(modelClass, dataClass, factory);
  return this;
}
 
Example 27
Project: GitHub   File: Registry.java   View source code 2 votes vote down vote up
/**
 * Prepends a new {@link ModelLoaderFactory} onto the beginning of the existing set so that the
 * constructed {@link ModelLoader} will be tried before all default and previously registered
 * {@link ModelLoader}s for the given model and data classes.
 *
 * <p>If you're attempting to add additional functionality or add a backup that should run only
 * after the default {@link ModelLoader}s run, use
 * {@link #append(Class, Class, ModelLoaderFactory)}. This method is best for adding an additional
 * case to Glide's existing functionality that should run first. This method will still run
 * Glide's default {@link ModelLoader}s if the prepended {@link ModelLoader}s fail.
 *
 * <p>If multiple {@link ModelLoaderFactory}s are registered for the same model and/or data
 * classes, the {@link ModelLoader}s they produce will be attempted in the order the
 * {@link ModelLoaderFactory}s were registered. Only if all {@link ModelLoader}s fail will the
 * entire request fail.
 *
 * @see #append(Class, Class, ModelLoaderFactory)
 * @see #replace(Class, Class, ModelLoaderFactory)
 *
 * @param modelClass The model class (e.g. URL, file path).
 * @param dataClass  the data class (e.g. {@link java.io.InputStream},
 * {@link java.io.FileDescriptor}).
 */
public <Model, Data> Registry prepend(Class<Model> modelClass, Class<Data> dataClass,
    ModelLoaderFactory<Model, Data> factory) {
  modelLoaderRegistry.prepend(modelClass, dataClass, factory);
  return this;
}
 
Example 28
Project: ApiAbstractionFramework   File: GlideLoaderFactory.java   View source code votes vote down vote up
ModelLoaderFactory<GlideUrl, InputStream> createUrlLoaderFactory();