Interface FactoryResolver<T>
- All Known Implementing Classes:
AbstractAttributeFactoryResolver
,AbstractPluginFactoryResolver
,OptionalFactoryResolver
,PluginAttributeFactoryResolver
,PluginBuilderAttributeFactoryResolver
,PluginElementFactoryResolver
,PluginListFactoryResolver
,PluginListSupplierFactoryResolver
,PluginMapFactoryResolver
,PluginMapSupplierFactoryResolver
,PluginNamespaceFactoryResolver
,PluginOptionalFactoryResolver
,PluginOptionalSupplierFactoryResolver
,PluginSetFactoryResolver
,PluginSetSupplierFactoryResolver
,PluginStreamFactoryResolver
,PluginStreamPluginTypeFactoryResolver
,PluginStreamSupplierFactoryResolver
,PluginTypeFactoryResolver
,PluginValueFactoryResolver
,SupplierFactoryResolver
public interface FactoryResolver<T>
Strategy for resolving factories from existing factories. This is useful for supporting plugin system
dependency injection such as configuration attributes, trees of plugin objects, and other conveniences.
-
Method Summary
Modifier and TypeMethodDescriptiongetFactory
(ResolvableKey<T> resolvableKey, InstanceFactory instanceFactory) Gets a factory for the given resolvable key using existing bindings from the given instance factory.boolean
supportsKey
(Key<?> key) Checks if this resolver supports the provided key.
-
Method Details
-
supportsKey
Checks if this resolver supports the provided key. If this returnstrue
, then the factory returned bygetFactory(ResolvableKey, InstanceFactory)
will be used to create a binding for the key.- Parameters:
key
- the key to check for support- Returns:
- true if this resolver supports the key
-
getFactory
Gets a factory for the given resolvable key using existing bindings from the given instance factory. A resolvable key in this context is aKey
combined with alias names and the annotated element this factory is for.- Parameters:
resolvableKey
- the resolvable key to create a binding forinstanceFactory
- the existing instance factory to use for composing bindings- Returns:
- a factory for instances described by the provided key
-