Registry

open class Registry

Manages component registration to extend or replace Glide's default loading, decoding, and encoding logic.

Constructors

Link copied to clipboard
open fun Registry()

Types

Link copied to clipboard
open class MissingComponentException : RuntimeException
Thrown when some necessary component is missing for a load.
Link copied to clipboard
Thrown when no ImageHeaderParser is registered.
Link copied to clipboard
Thrown when no com.bumptech.glide.load.model.ModelLoader is registered for a given model class.
Link copied to clipboard
Thrown when no ResourceEncoder is registered for a given resource class.
Link copied to clipboard
Thrown when no Encoder is registered for a given data class.

Functions

Link copied to clipboard
open fun <Data> append(dataClass: Class<Data>, encoder: Encoder<Data>): Registry
Appends the given Encoder onto the list of available Encoders so that it is attempted after all earlier and default Encoders for the given data class.
open fun <TResource> append(resourceClass: Class<TResource>, encoder: ResourceEncoder<TResource>): Registry
Appends the given ResourceEncoder into the list of available ResourceEncoders so that it is attempted after all earlier and default ResourceEncoders for the given data type.
open fun <Data, TResource> append(    dataClass: Class<Data>,     resourceClass: Class<TResource>,     decoder: ResourceDecoder<Data, TResource>): Registry
Appends the given ResourceDecoder onto the list of all available s allowing it to be used if all earlier and default ResourceDecoders for the given types fail (or there are none).
open fun <Model, Data> append(    modelClass: Class<Model>,     dataClass: Class<Data>,     factory: ModelLoaderFactory<Model, Data>): Registry
Appends a new ModelLoaderFactory onto the end of the existing set so that the constructed ModelLoader will be tried after all default and previously registered ModelLoaders for the given model and data classes.
open fun <Data, TResource> append(    bucket: String,     dataClass: Class<Data>,     resourceClass: Class<TResource>,     decoder: ResourceDecoder<Data, TResource>): Registry
Appends the given ResourceDecoder onto the list of available ResourceDecoders in this bucket, allowing it to be used if all earlier and default ResourceDecoders for the given types in this bucket fail (or there are none).
Link copied to clipboard
open fun getImageHeaderParsers(): List<ImageHeaderParser>
Link copied to clipboard
open fun <Data, TResource, Transcode> getLoadPath(    dataClass: Class<Data>,     resourceClass: Class<TResource>,     transcodeClass: Class<Transcode>): LoadPath<Data, TResource, Transcode>
Link copied to clipboard
open fun <Model> getModelLoaders(model: Model): List<ModelLoader<Model, out Any>>
Link copied to clipboard
open fun <Model, TResource, Transcode> getRegisteredResourceClasses(    modelClass: Class<Model>,     resourceClass: Class<TResource>,     transcodeClass: Class<Transcode>): List<Class<out Any>>
Link copied to clipboard
open fun <X> getResultEncoder(resource: Resource<X>): ResourceEncoder<X>
Link copied to clipboard
open fun <X> getRewinder(data: X): DataRewinder<X>
Link copied to clipboard
open fun <X> getSourceEncoder(data: X): Encoder<X>
Link copied to clipboard
open fun isResourceEncoderAvailable(resource: Resource<out Any>): Boolean
Link copied to clipboard
open fun <Data> prepend(dataClass: Class<Data>, encoder: Encoder<Data>): Registry
Prepends the given Encoder into the list of available Encoders so that it is attempted before all later and default Encoders for the given data class.
open fun <TResource> prepend(resourceClass: Class<TResource>, encoder: ResourceEncoder<TResource>): Registry
Prepends the given ResourceEncoder into the list of available ResourceEncoders so that it is attempted before all later and default ResourceEncoders for the given data type.
open fun <Data, TResource> prepend(    dataClass: Class<Data>,     resourceClass: Class<TResource>,     decoder: ResourceDecoder<Data, TResource>): Registry
Prepends the given ResourceDecoder into the list of all available s so that it is attempted before all later and default ResourceDecoders for the given types.
open fun <Model, Data> prepend(    modelClass: Class<Model>,     dataClass: Class<Data>,     factory: ModelLoaderFactory<Model, Data>): Registry
Prepends a new ModelLoaderFactory onto the beginning of the existing set so that the constructed ModelLoader will be tried before all default and previously registered ModelLoaders for the given model and data classes.
open fun <Data, TResource> prepend(    bucket: String,     dataClass: Class<Data>,     resourceClass: Class<TResource>,     decoder: ResourceDecoder<Data, TResource>): Registry
Prepends the given ResourceDecoder into the list of available ResourceDecoders in the same bucket so that it is attempted before all later and default s for the given types in that bucket.
Link copied to clipboard
open fun register(parser: ImageHeaderParser): Registry
Registers a new ImageHeaderParser that can obtain some basic metadata from an image header (orientation, type etc).
open fun register(factory: DataRewinder.Factory<out Any>): Registry
Registers a new com.bumptech.glide.load.data.DataRewinder.Factory to handle a non-default data type that can be rewind to allow for efficient reads of file headers.
open fun <Data> register(dataClass: Class<Data>, encoder: Encoder<Data>): Registry
Registers the given Encoder for the given data class (InputStream, FileDescriptor etc).
open fun <TResource> register(resourceClass: Class<TResource>, encoder: ResourceEncoder<TResource>): Registry
Appends the given ResourceEncoder into the list of available ResourceEncoders so that it is attempted after all earlier and default ResourceEncoders for the given data type.
open fun <TResource, Transcode> register(    resourceClass: Class<TResource>,     transcodeClass: Class<Transcode>,     transcoder: ResourceTranscoder<TResource, Transcode>): Registry
Registers the given ResourceTranscoder to convert from the given resource Class to the given transcode Class.
Link copied to clipboard
open fun <Model, Data> replace(    modelClass: Class<Model>,     dataClass: Class<Data>,     factory: ModelLoaderFactory<out Model, out Data>): Registry
Removes all default and previously registered ModelLoaderFactorys for the given data and model class and replaces all of them with the single ModelLoader provided.
Link copied to clipboard
fun setResourceDecoderBucketPriorityList(buckets: List<String>): Registry
Overrides the default ordering of resource decoder buckets.

Properties

Link copied to clipboard
val BUCKET_ANIMATION: String
Link copied to clipboard
val BUCKET_BITMAP: String
Link copied to clipboard
val BUCKET_BITMAP_DRAWABLE: String
Link copied to clipboard
val BUCKET_GIF: String