|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectroboguice.RoboGuice
public class RoboGuice
Manages injectors for RoboGuice applications.
There are two types of injectors:
1. The base application injector, which is not typically used directly by the user.
2. The ContextScopedInjector, which is obtained by calling getInjector(android.content.Context)
, and knows about
your current context, whether it's an activity, service, or something else.
BUG hashmap should also key off of stage and modules list
Nested Class Summary | |
---|---|
static class |
RoboGuice.util
|
Field Summary | |
---|---|
static com.google.inject.Stage |
DEFAULT_STAGE
|
protected static WeakHashMap<android.app.Application,com.google.inject.Injector> |
injectors
|
protected static int |
modulesResourceId
|
protected static WeakHashMap<android.app.Application,ResourceListener> |
resourceListeners
|
protected static WeakHashMap<android.app.Application,ViewListener> |
viewListeners
|
Method Summary | ||
---|---|---|
static void |
destroyInjector(android.content.Context context)
|
|
static com.google.inject.Injector |
getBaseApplicationInjector(android.app.Application application)
Return the cached Injector instance for this application, or create a new one if necessary. |
|
static RoboInjector |
getInjector(android.content.Context context)
|
|
protected static ResourceListener |
getResourceListener(android.app.Application application)
|
|
protected static ViewListener |
getViewListener(android.app.Application application)
|
|
static
|
injectMembers(android.content.Context context,
T t)
A shortcut for RoboGuice.getInjector(context).injectMembers(o); |
|
static DefaultRoboModule |
newDefaultRoboModule(android.app.Application application)
|
|
static com.google.inject.Injector |
setBaseApplicationInjector(android.app.Application application,
com.google.inject.Stage stage)
Return the cached Injector instance for this application, or create a new one if necessary. |
|
static com.google.inject.Injector |
setBaseApplicationInjector(android.app.Application application,
com.google.inject.Stage stage,
com.google.inject.Module... modules)
Return the cached Injector instance for this application, or create a new one if necessary. |
|
static void |
setModulesResourceId(int modulesResourceId)
Allows the user to override the "roboguice_modules" resource name with some other identifier. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static com.google.inject.Stage DEFAULT_STAGE
protected static WeakHashMap<android.app.Application,com.google.inject.Injector> injectors
protected static WeakHashMap<android.app.Application,ResourceListener> resourceListeners
protected static WeakHashMap<android.app.Application,ViewListener> viewListeners
protected static int modulesResourceId
Method Detail |
---|
public static com.google.inject.Injector getBaseApplicationInjector(android.app.Application application)
public static com.google.inject.Injector setBaseApplicationInjector(android.app.Application application, com.google.inject.Stage stage, com.google.inject.Module... modules)
Modules.override(com.google.inject.Module...)
,
setBaseApplicationInjector(android.app.Application, com.google.inject.Stage, com.google.inject.Module...)
,
newDefaultRoboModule(android.app.Application)
,
If using this method with test cases, be sure to call {@link roboguice.RoboGuice.util#reset()} in your test teardown methods
to avoid polluting our other tests with your custom injector. Don't do this in your real application though.
public static void setModulesResourceId(int modulesResourceId)
public static com.google.inject.Injector setBaseApplicationInjector(android.app.Application application, com.google.inject.Stage stage)
public static RoboInjector getInjector(android.content.Context context)
public static <T> T injectMembers(android.content.Context context, T t)
public static DefaultRoboModule newDefaultRoboModule(android.app.Application application)
protected static ResourceListener getResourceListener(android.app.Application application)
protected static ViewListener getViewListener(android.app.Application application)
public static void destroyInjector(android.content.Context context)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |