Interface IExtensionPointBinder<T>

Type Parameters:
T - General class/interface

public interface IExtensionPointBinder<T>
IOC binder

Usage: Use the bind interface from the IExtensionPointIoc class, to get a binder from your specified generic class. Then call a to method to bind it to the specific implementation or provider. It is intended to be used from the configure method in the IExtensionPointConfiguration

Example:
  public void configure(IExtensionPointIoc iExtensionPointIoc) {
      iExtensionPointIoc.bind(IService.class).to(CustomService.class);
  }
 
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    <E extends T>
    void
    exclusivelyTo(Class<E> toClass)
    Bind exclusively to a class, and let the IOC construct the object for you.
    void
    exclusivelyTo(javax.inject.Provider<? extends T> provider)
    Bind exclusively to a provider, where you can construct the object yourself.
    <E extends T>
    void
    to(Class<E> toClass)
    Bind to a class, and let the IOC construct the object for you.
    void
    to(javax.inject.Provider<? extends T> provider)
    Bind to a provider, where you can construct the object yourself.
  • Method Details

    • to

      <E extends T> void to(Class<E> toClass)
      Bind to a class, and let the IOC construct the object for you.
      Type Parameters:
      E - generic class
      Parameters:
      toClass - specific implementation
      Throws:
      IllegalArgumentException - if there is an existing exclusive binding
    • to

      void to(javax.inject.Provider<? extends T> provider)
      Bind to a provider, where you can construct the object yourself.
      Parameters:
      provider - the provider implementation
      Throws:
      IllegalArgumentException - if there is an existing exclusive binding
    • exclusivelyTo

      <E extends T> void exclusivelyTo(Class<E> toClass)
      Bind exclusively to a class, and let the IOC construct the object for you. This method will fail if there is any existing binding. If it succeeds, all future attempts to bind will fail.
      Type Parameters:
      E - generic class
      Parameters:
      toClass - specific implementation
      Throws:
      IllegalArgumentException - if there is any existing binding
    • exclusivelyTo

      void exclusivelyTo(javax.inject.Provider<? extends T> provider)
      Bind exclusively to a provider, where you can construct the object yourself. This method will fail if there is any existing binding. If it succeeds, all future attempts to bind will fail.
      Parameters:
      provider - the provider implementation
      Throws:
      IllegalArgumentException - if there is any existing binding