com.google.gwt.inject.rebind.binding
Interface Binding

All Known Implementing Classes:
AsyncProviderBinding, BindClassBinding, BindConstantBinding, BindProviderBinding, CallConstructorBinding, CallGwtDotCreateBinding, ExposedChildBinding, FactoryBinding, GinjectorBinding, ImplicitProviderBinding, ParentBinding, ProviderMethodBinding, RemoteServiceProxyBinding

public interface Binding

Interface used by InjectorGeneratorImpl to represent different kinds of bindings.


Method Summary
 Context getContext()
          Returns the context in which this binding was created.
 SourceSnippet getCreationStatements(NameGenerator nameGenerator, java.util.List<InjectorMethod> methodsOutput)
          Gets one or more fully formed Java statements that create the bound value and store it in a new local variable named result.
 java.util.Collection<Dependency> getDependencies()
          Returns the set of dependencies that this binding produces.
 java.lang.String getGetterMethodPackage()
          Returns the package in which the getter for the bound key is created.
 java.util.Collection<TypeLiteral<?>> getMemberInjectRequests()
          Returns the set of types for which this binding requires member injection methods to be written.
 

Method Detail

getCreationStatements

SourceSnippet getCreationStatements(NameGenerator nameGenerator,
                                    java.util.List<InjectorMethod> methodsOutput)
                                    throws NoSourceNameException
Gets one or more fully formed Java statements that create the bound value and store it in a new local variable named result. If additional methods are to be created, the given NameGenerator should be used to choose their names, and they should be added to methodsOutput.

Throws:
NoSourceNameException - if source name is not available for type

getContext

Context getContext()
Returns the context in which this binding was created.


getGetterMethodPackage

java.lang.String getGetterMethodPackage()
Returns the package in which the getter for the bound key is created. This is used by other bindings and by the top-level interface to determine which package this binding's method was written to. Implementors may assume that all other bindings have been created and placed in their respective GinjectorBindings objects.

Typically this will be the package containing the type that is returned by the getter, but the only requirement is that it has to be a package where the return type is visible.


getDependencies

java.util.Collection<Dependency> getDependencies()
Returns the set of dependencies that this binding produces. This contains edges coming into the key that this type binds (from Dependency.GINJECTOR) as well as dependencies that this binding needs.


getMemberInjectRequests

java.util.Collection<TypeLiteral<?>> getMemberInjectRequests()
Returns the set of types for which this binding requires member injection methods to be written.