|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.inject.rebind.GinjectorBindings
public class GinjectorBindings
Stores information that describes the bindings present in a given injector, and the relationship to the other injectors in the hierarchy. This class is used in two stages:
BindingsProcessor
this
gathers up explicit bindings and unresolved dependencies. After all bindings
have been gathered from the modules, resolveBindings()
is called in
the last stage of processing and it is finalized. After that point, no new
unresolved bindings should be added.
GinjectorOutputter
for
generating the Ginjector implementation. In this stage several additional
methods are available for getting information about the code that has been
generated to represent this ginjector.
Each GinjectorBindings
can have a parent ginjector, and any number of
child ginjectors.
Constructor Summary | |
---|---|
GinjectorBindings(NameGenerator nameGenerator,
com.google.gwt.core.ext.TreeLogger logger,
GuiceUtil guiceUtil,
java.lang.Class<? extends Ginjector> ginjectorInterface,
javax.inject.Provider<GinjectorBindings> ginjectorBindingsProvider,
MemberCollector collector,
ErrorManager errorManager,
BindingResolver bindingResolver)
|
Method Summary | |
---|---|
void |
addBinding(Key<?> key,
Binding binding)
|
void |
addDependencies(java.util.Collection<Dependency> dependencies)
|
void |
addDependency(Dependency dependency)
|
void |
addFactoryModule(FactoryModule<?> install)
|
void |
addPin(Key<?> key)
|
GinjectorBindings |
createChildGinjectorBindings(java.lang.Class<?> module)
Create a new GinjectorBindings that collects bindings for an injector that is the
child of this GinjectorBindings . |
GinScope |
determineScope(Key<?> key)
|
Binding |
getBinding(Key<?> key)
|
java.lang.Iterable<java.util.Map.Entry<Key<?>,Binding>> |
getBindings()
|
java.lang.Iterable<Key<?>> |
getBoundKeys()
|
java.lang.Iterable<GinjectorBindings> |
getChildren()
|
GinjectorBindings |
getChildWhichBindsLocally(Key<?> key)
Returns the child injector which binds the given key. |
java.lang.Iterable<Dependency> |
getDependencies()
|
java.lang.Iterable<FactoryModule<?>> |
getFactoryModules()
|
TypeLiteral<?> |
getGinjectorInterface()
|
java.lang.Iterable<TypeLiteral<?>> |
getMemberInjectRequests()
|
java.lang.Class<?> |
getModule()
|
java.lang.String |
getModuleName()
|
NameGenerator |
getNameGenerator()
|
GinjectorBindings |
getParent()
|
java.util.Collection<java.lang.Class<?>> |
getStaticInjectionRequests()
|
boolean |
hasEagerSingletonBindingInSubtree()
Returns true if any binding in this injector or in one of its
descendants is an eager singleton binding. |
boolean |
hasStaticInjectionRequestInSubtree()
Returns true if this injector or any of its children has a static
injection request. |
boolean |
isBound(Key<?> key)
Returns true if the passed key is bound in the Ginjector. |
boolean |
isBoundLocallyInChild(Key<?> key)
|
boolean |
isPinned(Key<?> key)
|
void |
resolveBindings()
|
void |
setModule(java.lang.Class<?> module)
|
void |
setParent(GinjectorBindings parent)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
@Inject public GinjectorBindings(NameGenerator nameGenerator, com.google.gwt.core.ext.TreeLogger logger, GuiceUtil guiceUtil, java.lang.Class<? extends Ginjector> ginjectorInterface, javax.inject.Provider<GinjectorBindings> ginjectorBindingsProvider, MemberCollector collector, ErrorManager errorManager, BindingResolver bindingResolver)
Method Detail |
---|
public GinjectorBindings createChildGinjectorBindings(java.lang.Class<?> module)
GinjectorBindings
that collects bindings for an injector that is the
child of this GinjectorBindings
.
module
- the module the ginjector is being created for
GinjectorBindings
public void resolveBindings() throws com.google.gwt.core.ext.UnableToCompleteException
com.google.gwt.core.ext.UnableToCompleteException
public java.lang.Iterable<Dependency> getDependencies()
public java.lang.Iterable<Key<?>> getBoundKeys()
public java.lang.Iterable<java.util.Map.Entry<Key<?>,Binding>> getBindings()
public TypeLiteral<?> getGinjectorInterface()
public java.util.Collection<java.lang.Class<?>> getStaticInjectionRequests()
public java.lang.Iterable<TypeLiteral<?>> getMemberInjectRequests()
public boolean hasEagerSingletonBindingInSubtree()
true
if any binding in this injector or in one of its
descendants is an eager singleton binding.
Note: this method is Omega(n) in the height of the injector tree, and invoking it on every entry in the injector tree is O(n^2). The latter cost could be reduced to O(n) by caching the return value.
public boolean hasStaticInjectionRequestInSubtree()
true
if this injector or any of its children has a static
injection request.
Note: this method is Omega(n) in the height of the injector tree, and invoking it on every entry in the injector tree is O(n^2). The latter cost could be reduced to O(n) by caching the return value.
public GinjectorBindings getParent()
public void setParent(GinjectorBindings parent)
public java.lang.Class<?> getModule()
public java.lang.String getModuleName()
public void setModule(java.lang.Class<?> module)
public java.lang.Iterable<GinjectorBindings> getChildren()
public java.lang.Iterable<FactoryModule<?>> getFactoryModules()
public NameGenerator getNameGenerator()
public GinScope determineScope(Key<?> key)
public boolean isBound(Key<?> key)
BindingIndex
isBound
in interface BindingIndex
key
- key to be checked
public Binding getBinding(Key<?> key)
public void addDependency(Dependency dependency)
public void addDependencies(java.util.Collection<Dependency> dependencies)
public void addBinding(Key<?> key, Binding binding)
public void addPin(Key<?> key)
public boolean isPinned(Key<?> key)
public boolean isBoundLocallyInChild(Key<?> key)
public GinjectorBindings getChildWhichBindsLocally(Key<?> key)
null
.
public void addFactoryModule(FactoryModule<?> install)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |