|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Scope
A scope which bound objects can reside in. Mapping scopes by name with
ContainerBuilder.scope(java.lang.String, com.google.inject.Scope)
can help avoid compile time dependencies
on the Scope
implementation (if desired) and enable the use of the
Scoped
annotation.
Scope implementations should override #toString
in the returned
factory and include the creator's {#toString} output. Doing so aids
debugging. They should also override their own #toString
method.
Method Summary | ||
---|---|---|
|
scope(Key<T> key,
Factory<T> creator)
Scopes a factory. |
Method Detail |
---|
<T> Factory<T> scope(Key<T> key, Factory<T> creator)
key
- binding keycreator
- creates new instances as needed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |