org.apache.commons.inject.impl.bind
Class DefaultBindingBuilder<T>

java.lang.Object
  extended by org.apache.commons.inject.impl.bind.DefaultBindingBuilder<T>
All Implemented Interfaces:
IAnnotatedBindingBuilder<T>, ILinkedBindingBuilder<T>, IScopedBindingBuilder<T>

public class DefaultBindingBuilder<T>
extends Object
implements IAnnotatedBindingBuilder<T>

Default implementation of a binding builder. Implements IAnnotatedBindingBuilder, thus IScopedBindingBuilder, and ILinkedBindingBuilder as well. In other words: Under the hood, you are always using this one and only binding builder.


Constructor Summary
DefaultBindingBuilder(Class<T> pType)
           
DefaultBindingBuilder(Class<T> pType, String pName)
           
DefaultBindingBuilder(IKey<T> pKey)
           
 
Method Summary
 ILinkedBindingBuilder<T> annotatedWith(Annotation pAnnotation)
          Specifies, that the binding can only be used for injection, if a field is annotated with an Annotation, that equals the given.
 ILinkedBindingBuilder<T> annotatedWith(Class<? extends Annotation> pAnnotationType)
          Specifies, that the binding can only be used for injection, if a field is annotated with an Annotation of the given type.
 void asEagerSingleton()
           
 void asLazySingleton()
           
 void build(MutableBindingSet pBindings, List<IBinder.IInjectionListener> pListeners, List<IBinder.IInjectionParticipator> pParticipators)
           
 AbstractScopedProvider<T> getScopedProvider(IProvider<T> pBaseProvider)
           
 void scope(Scopes pScope)
           
 IScopedBindingBuilder<T> to(Class<? extends T> pImplClass)
           
<S extends T>
IScopedBindingBuilder<T>
to(Class<S> pType, com.google.inject.Provider<S> pProvider)
           
 IScopedBindingBuilder<T> to(Constructor<? extends T> pConstructor)
           
 IScopedBindingBuilder<T> to(IProvider<? extends T> pProvider)
           
 IScopedBindingBuilder<T> to(Method pFactoryMethod)
           
 void toInstance(T pInstance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBindingBuilder

public DefaultBindingBuilder(Class<T> pType)

DefaultBindingBuilder

public DefaultBindingBuilder(Class<T> pType,
                             String pName)

DefaultBindingBuilder

public DefaultBindingBuilder(IKey<T> pKey)
Method Detail

toInstance

public void toInstance(T pInstance)
Specified by:
toInstance in interface ILinkedBindingBuilder<T>

to

public IScopedBindingBuilder<T> to(Class<? extends T> pImplClass)
Specified by:
to in interface ILinkedBindingBuilder<T>

to

public IScopedBindingBuilder<T> to(Constructor<? extends T> pConstructor)
Specified by:
to in interface ILinkedBindingBuilder<T>

to

public IScopedBindingBuilder<T> to(Method pFactoryMethod)
Specified by:
to in interface ILinkedBindingBuilder<T>

to

public <S extends T> IScopedBindingBuilder<T> to(Class<S> pType,
                                                 com.google.inject.Provider<S> pProvider)
Specified by:
to in interface ILinkedBindingBuilder<T>

to

public IScopedBindingBuilder<T> to(IProvider<? extends T> pProvider)
Specified by:
to in interface ILinkedBindingBuilder<T>

scope

public void scope(Scopes pScope)
Specified by:
scope in interface IScopedBindingBuilder<T>

asEagerSingleton

public void asEagerSingleton()
Specified by:
asEagerSingleton in interface IScopedBindingBuilder<T>

asLazySingleton

public void asLazySingleton()
Specified by:
asLazySingleton in interface IScopedBindingBuilder<T>

annotatedWith

public ILinkedBindingBuilder<T> annotatedWith(Annotation pAnnotation)
Description copied from interface: IAnnotatedBindingBuilder
Specifies, that the binding can only be used for injection, if a field is annotated with an Annotation, that equals the given. In general, this means that the annotation type, and all attributes are equal.

Specified by:
annotatedWith in interface IAnnotatedBindingBuilder<T>
See Also:
Annotation.equals(Object)

annotatedWith

public ILinkedBindingBuilder<T> annotatedWith(Class<? extends Annotation> pAnnotationType)
Description copied from interface: IAnnotatedBindingBuilder
Specifies, that the binding can only be used for injection, if a field is annotated with an Annotation of the given type.

Specified by:
annotatedWith in interface IAnnotatedBindingBuilder<T>

build

public void build(MutableBindingSet pBindings,
                  List<IBinder.IInjectionListener> pListeners,
                  List<IBinder.IInjectionParticipator> pParticipators)

getScopedProvider

public AbstractScopedProvider<T> getScopedProvider(IProvider<T> pBaseProvider)


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.