Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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
`
`<T> BindingBuilder<T>`
` | `bind(java.lang.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(java.lang.String bindingName)` Starts a binding of a java.util.List distinguished by its binding name.
`
`<T> MapBuilder<T>`
` | `bindMap(java.lang.String bindingName)` Starts a binding of a java.util.Map distinguished by its binding name.

Method Detail

### bind

    <T> BindingBuilder<T> bind(java.lang.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(java.lang.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(java.lang.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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2012 Apache Cayenne. All Rights Reserved.