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 Type
    Method
    Description
    getFactory(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

      boolean supportsKey(Key<?> key)
      Checks if this resolver supports the provided key. If this returns true, then the factory returned by getFactory(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

      Supplier<T> getFactory(ResolvableKey<T> resolvableKey, InstanceFactory instanceFactory)
      Gets a factory for the given resolvable key using existing bindings from the given instance factory. A resolvable key in this context is a Key combined with alias names and the annotated element this factory is for.
      Parameters:
      resolvableKey - the resolvable key to create a binding for
      instanceFactory - the existing instance factory to use for composing bindings
      Returns:
      a factory for instances described by the provided key