Silk DI 0.6


se.jbee.inject.bind
Class Binder

Object
  extended by se.jbee.inject.bind.Binder
Direct Known Subclasses:
Binder.TargetedBinder

public class Binder
extends Object

The default implementation of a fluent binder interface that provides a lot of utility methods to improve readability and keep binding compact.

Author:
Jan Bernitt (jan@jbee.se)

Nested Class Summary
static class Binder.ConfigBinder<T>
           
static class Binder.InspectBinder
           
static class Binder.RootBinder
           
static class Binder.ScopedBinder
           
static class Binder.TargetedBinder
           
static class Binder.TypedBinder<T>
           
static class Binder.TypedElementBinder<E>
          This kind of bindings actually re-map the []-type so that the automatic behavior of returning all known instances of the element type will no longer be used whenever the bind made applies.
 
Field Summary
(package private)  Binder.RootBinder root
           
 
Constructor Summary
Binder(Binder.RootBinder root, Bind bind)
           
 
Method Summary
<E> Binder.TypedElementBinder<E>
arraybind(Class<E[]> type)
           
<T> Binder.TypedBinder<T>
autobind(Class<T> type)
           
<T> Binder.TypedBinder<T>
autobind(Type<T> type)
           
(package private)  Bind bind()
           
<T> Binder.TypedBinder<T>
bind(Class<T> type)
           
<T> Binder.TypedBinder<T>
bind(Instance<T> instance)
           
<T> Binder.TypedBinder<T>
bind(Name name, Class<T> type)
           
<T> Binder.TypedBinder<T>
bind(Name name, Type<T> type)
           
<T> Binder.TypedBinder<T>
bind(Type<T> type)
           
<T,C> Binder.ConfigBinder<T>
configbind(Class<T> type)
           
<T,C> Binder.ConfigBinder<T>
configbind(Type<T> type)
           
 void construct(Class<?> type)
           
 void construct(Instance<?> instance)
           
 void construct(Name name, Class<?> type)
           
static Binder.RootBinder create(Bind bind)
           
protected  Binder implicit()
           
protected
<I> void
implicitBindToConstructor(Class<I> impl)
           
protected
<I> void
implicitBindToConstructor(Instance<I> instance)
           
<T> Binder.TypedBinder<T>
multibind(Class<T> type)
           
<T> Binder.TypedBinder<T>
multibind(Instance<T> instance)
           
<T> Binder.TypedBinder<T>
multibind(Name name, Class<T> type)
           
<T> Binder.TypedBinder<T>
multibind(Name name, Type<T> type)
           
<T> Binder.TypedBinder<T>
multibind(Type<T> type)
           
protected  Binder on(Bind bind)
           
<T> Binder.TypedBinder<T>
starbind(Class<T> type)
           
protected  Binder with(Target target)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

final Binder.RootBinder root
Constructor Detail

Binder

Binder(Binder.RootBinder root,
       Bind bind)
Method Detail

create

public static Binder.RootBinder create(Bind bind)

bind

Bind bind()

arraybind

public <E> Binder.TypedElementBinder<E> arraybind(Class<E[]> type)

autobind

public <T> Binder.TypedBinder<T> autobind(Class<T> type)

autobind

public <T> Binder.TypedBinder<T> autobind(Type<T> type)

bind

public <T> Binder.TypedBinder<T> bind(Class<T> type)

bind

public <T> Binder.TypedBinder<T> bind(Instance<T> instance)

bind

public <T> Binder.TypedBinder<T> bind(Name name,
                                      Class<T> type)

bind

public <T> Binder.TypedBinder<T> bind(Name name,
                                      Type<T> type)

bind

public <T> Binder.TypedBinder<T> bind(Type<T> type)

construct

public void construct(Class<?> type)

construct

public void construct(Instance<?> instance)

construct

public void construct(Name name,
                      Class<?> type)

multibind

public <T> Binder.TypedBinder<T> multibind(Class<T> type)

multibind

public <T> Binder.TypedBinder<T> multibind(Instance<T> instance)

multibind

public <T> Binder.TypedBinder<T> multibind(Name name,
                                           Class<T> type)

multibind

public <T> Binder.TypedBinder<T> multibind(Name name,
                                           Type<T> type)

multibind

public <T> Binder.TypedBinder<T> multibind(Type<T> type)

starbind

public <T> Binder.TypedBinder<T> starbind(Class<T> type)

configbind

public <T,C> Binder.ConfigBinder<T> configbind(Class<T> type)

configbind

public <T,C> Binder.ConfigBinder<T> configbind(Type<T> type)

on

protected Binder on(Bind bind)

implicitBindToConstructor

protected final <I> void implicitBindToConstructor(Class<I> impl)

implicitBindToConstructor

protected final <I> void implicitBindToConstructor(Instance<I> instance)

implicit

protected final Binder implicit()

with

protected Binder with(Target target)

Silk DI 0.6