public interface RhythmSpecLayerFactory<T extends RhythmSpecLayer>
Interface for a factory that can instantiate a RhythmSpecLayer
implementation from provided ArgumentsBundle
. These factories are used by RhythmOverlayInflater
to inflate declarative config into
respective overlays. If you make a custom spec layer, you should also create a corresponding
RhythmSpecLayerFactory
and register it within RhythmOverlayInflater.registerFactory(String,
RhythmSpecLayerFactory)
method.
Concrete factories may implement some sort of caching and provide the same
RhythmSpecLayer
instances for equal ArgumentsBundles if they can be reused, but
it's not mandatory. Furthermore it’s developer’s responsibility to not mutate the layer if the latter is reused in
multiple overlays.
Modifier and Type | Method and Description |
---|---|
T |
getForArguments(ArgumentsBundle argsBundle)
Create and configure a spec layer from provided arguments, or get previously created one from cache if it can be
safely reused.
|
T getForArguments(ArgumentsBundle argsBundle)
argsBundle
- container with arguments for this layer