public class Registry extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Registry.MissingComponentException
Thrown when some necessary component is missing for a load.
|
static class |
Registry.NoImageHeaderParserException
Thrown when no
ImageHeaderParser is registered. |
static class |
Registry.NoModelLoaderAvailableException
Thrown when no
ModelLoader is registered for a given
model class. |
static class |
Registry.NoResultEncoderAvailableException
Thrown when no
ResourceEncoder is registered for a given resource class. |
static class |
Registry.NoSourceEncoderAvailableException
Thrown when no
Encoder is registered for a given data class. |
Constructor and Description |
---|
Registry() |
Modifier and Type | Method and Description |
---|---|
<Data,TResource> |
append(Class<Data> dataClass,
Class<TResource> resourceClass,
ResourceDecoder<Data,TResource> decoder) |
<Model,Data> |
append(Class<Model> modelClass,
Class<Data> dataClass,
ModelLoaderFactory<Model,Data> factory)
Use the given factory to build a
ModelLoader for models
of the given class. |
List<ImageHeaderParser> |
getImageHeaderParsers() |
<Data,TResource,Transcode> |
getLoadPath(Class<Data> dataClass,
Class<TResource> resourceClass,
Class<Transcode> transcodeClass) |
<Model> List<ModelLoader<Model,?>> |
getModelLoaders(Model model) |
<Model,TResource,Transcode> |
getRegisteredResourceClasses(Class<Model> modelClass,
Class<TResource> resourceClass,
Class<Transcode> transcodeClass) |
<X> ResourceEncoder<X> |
getResultEncoder(Resource<X> resource) |
<X> DataRewinder<X> |
getRewinder(X data) |
<X> Encoder<X> |
getSourceEncoder(X data) |
boolean |
isResourceEncoderAvailable(Resource<?> resource) |
<Data,TResource> |
prepend(Class<Data> dataClass,
Class<TResource> resourceClass,
ResourceDecoder<Data,TResource> decoder) |
<Model,Data> |
prepend(Class<Model> modelClass,
Class<Data> dataClass,
ModelLoaderFactory<Model,Data> factory) |
<Data> Registry |
register(Class<Data> dataClass,
Encoder<Data> encoder) |
<TResource,Transcode> |
register(Class<TResource> resourceClass,
Class<Transcode> transcodeClass,
ResourceTranscoder<TResource,Transcode> transcoder) |
<TResource> |
register(Class<TResource> resourceClass,
ResourceEncoder<TResource> encoder) |
Registry |
register(DataRewinder.Factory factory) |
Registry |
register(ImageHeaderParser parser) |
<Model,Data> |
replace(Class<Model> modelClass,
Class<Data> dataClass,
ModelLoaderFactory<Model,Data> factory) |
public <Data,TResource> Registry append(Class<Data> dataClass, Class<TResource> resourceClass, ResourceDecoder<Data,TResource> decoder)
public <Data,TResource> Registry prepend(Class<Data> dataClass, Class<TResource> resourceClass, ResourceDecoder<Data,TResource> decoder)
public <TResource> Registry register(Class<TResource> resourceClass, ResourceEncoder<TResource> encoder)
public Registry register(DataRewinder.Factory factory)
public <TResource,Transcode> Registry register(Class<TResource> resourceClass, Class<Transcode> transcodeClass, ResourceTranscoder<TResource,Transcode> transcoder)
public Registry register(ImageHeaderParser parser)
public <Model,Data> Registry append(Class<Model> modelClass, Class<Data> dataClass, ModelLoaderFactory<Model,Data> factory)
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 ModelLoaderFactory.teardown()
} method called.
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, ModelLoaderFactory.teardown()
will
be called.
Note - The factory must not be an anonymous inner class of an Activity or another object that cannot be retained statically.
modelClass
- The model class.dataClass
- the data class.public <Model,Data> Registry prepend(Class<Model> modelClass, Class<Data> dataClass, ModelLoaderFactory<Model,Data> factory)
public <Model,Data> Registry replace(Class<Model> modelClass, Class<Data> dataClass, ModelLoaderFactory<Model,Data> factory)
public <Data,TResource,Transcode> LoadPath<Data,TResource,Transcode> getLoadPath(Class<Data> dataClass, Class<TResource> resourceClass, Class<Transcode> transcodeClass)
public <Model,TResource,Transcode> List<Class<?>> getRegisteredResourceClasses(Class<Model> modelClass, Class<TResource> resourceClass, Class<Transcode> transcodeClass)
public boolean isResourceEncoderAvailable(Resource<?> resource)
public <X> ResourceEncoder<X> getResultEncoder(Resource<X> resource) throws Registry.NoResultEncoderAvailableException
public <X> Encoder<X> getSourceEncoder(X data) throws Registry.NoSourceEncoderAvailableException
public <X> DataRewinder<X> getRewinder(X data)
public <Model> List<ModelLoader<Model,?>> getModelLoaders(Model model)
public List<ImageHeaderParser> getImageHeaderParsers()