com.google.inject.spi
Class ModuleWriter

java.lang.Object
  extended by com.google.inject.spi.ModuleWriter

public class ModuleWriter
extends Object

Creates a Module from a collection of component elements.

Since:
2.0

Constructor Summary
ModuleWriter()
           
 
Method Summary
 void apply(Binder binder, Iterable<? extends Element> elements)
          Replays elements against binder.
protected  void applyScoping(Binding<?> binding, ScopedBindingBuilder scopedBindingBuilder)
           
protected
<T> ScopedBindingBuilder
bindKeyToTarget(Binding<T> binding, Binder binder, Key<T> key)
          Execute this target against the linked binding builder.
 Module create(Iterable<? extends Element> elements)
          Returns a module that executes the specified elements using this executing visitor.
protected  PrivateBinder getPrivateBinder(PrivateElements privateElements)
          Returns the binder accociated with privateElements.
protected  void setPrivateBinder(PrivateElements privateElements, PrivateBinder binder)
          Associates binder with privateElements.
protected
<T> void
writeBind(Binder binder, Binding<T> element)
           
protected  void writeBindInterceptor(Binder binder, InterceptorBinding element)
           
protected  void writeBindScope(Binder binder, ScopeBinding element)
           
protected  void writeConvertToTypes(Binder binder, TypeConverterBinding element)
           
protected
<T> void
writeGetProvider(Binder binder, ProviderLookup<T> element)
           
protected  void writeMessage(Binder binder, Message element)
           
protected  void writePrivateElements(Binder binder, PrivateElements element)
          Writes the elements of the private environment to a new private binder and associates the two.
protected  void writeRequestInjection(Binder binder, InjectionRequest command)
           
protected  void writeRequestStaticInjection(Binder binder, StaticInjectionRequest element)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleWriter

public ModuleWriter()
Method Detail

create

public final Module create(Iterable<? extends Element> elements)
Returns a module that executes the specified elements using this executing visitor.


apply

public final void apply(Binder binder,
                        Iterable<? extends Element> elements)
Replays elements against binder.


writeMessage

protected void writeMessage(Binder binder,
                            Message element)

writeBindInterceptor

protected void writeBindInterceptor(Binder binder,
                                    InterceptorBinding element)

writeBindScope

protected void writeBindScope(Binder binder,
                              ScopeBinding element)

writeRequestInjection

protected void writeRequestInjection(Binder binder,
                                     InjectionRequest command)

writeRequestStaticInjection

protected void writeRequestStaticInjection(Binder binder,
                                           StaticInjectionRequest element)

writeConvertToTypes

protected void writeConvertToTypes(Binder binder,
                                   TypeConverterBinding element)

writeBind

protected <T> void writeBind(Binder binder,
                             Binding<T> element)

writePrivateElements

protected void writePrivateElements(Binder binder,
                                    PrivateElements element)
Writes the elements of the private environment to a new private binder and associates the two.


bindKeyToTarget

protected <T> ScopedBindingBuilder bindKeyToTarget(Binding<T> binding,
                                                   Binder binder,
                                                   Key<T> key)
Execute this target against the linked binding builder.


setPrivateBinder

protected void setPrivateBinder(PrivateElements privateElements,
                                PrivateBinder binder)
Associates binder with privateElements.


getPrivateBinder

protected PrivateBinder getPrivateBinder(PrivateElements privateElements)
Returns the binder accociated with privateElements. This can be used to expose bindings to the enclosing environment.


applyScoping

protected void applyScoping(Binding<?> binding,
                            ScopedBindingBuilder scopedBindingBuilder)

writeGetProvider

protected <T> void writeGetProvider(Binder binder,
                                    ProviderLookup<T> element)