org.apache.cayenne.di

## Interface Binder

-     public interface Binder

  An object passed to a `Module` by the DI container during initialization, that provides the API for the module to bind its services to the container. Note that the default `Scope` of the bound objects is normally "singleton" and can be changed to "no scope" or a custom scope via a corresponding method of a binding builder. E.g. see `BindingBuilder.in(Scope)`.
  Since:
    3.1

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> BindingBuilder<T>` | `bind(Class<T> interfaceType)` Starts an unnamed binding of a specific interface.
    `<T> BindingBuilder<T>` | `bind(Key<T> key)` Starts a binding of a specific interface based on a provided binding key.
    `<T> ListBuilder<T>` | `bindList(String bindingName)` Starts a binding of a java.util.List distinguished by its binding name.
    `<T> MapBuilder<T>` | `bindMap(String bindingName)` Starts a binding of a java.util.Map distinguished by its binding name.

- - ### Method Detail

    - #### bind

          <T> BindingBuilder<T> bind(Class<T> interfaceType)

      Starts an unnamed binding of a specific interface. Binding should continue using returned BindingBuilder.

    - #### bind

          <T> BindingBuilder<T> bind(Key<T> key)

      Starts a binding of a specific interface based on a provided binding key. This method is more generic than `bind(Class)` and allows to create named bindings in addition to default ones. Binding should continue using returned BindingBuilder.

    - #### bindMap

          <T> MapBuilder<T> bindMap(String bindingName)

      Starts a binding of a java.util.Map distinguished by its binding name. Map binding should continue using returned MapBuilder. This is somewhat equivalent of using "bind(Map.class, bindingName)", however returned MapBuilder provides extra DI capabilities.

    - #### bindList

          <T> ListBuilder<T> bindList(String bindingName)

      Starts a binding of a java.util.List distinguished by its binding name. List binding should continue using returned ListBuilder. This is somewhat equivalent of using "bind(List.class, bindingName)", however returned ListBuilder provides extra DI capabilities.

Copyright © 2001–2018 Apache Cayenne. All rights reserved.