Modifier and Type | Method and Description |
---|---|
static void |
configureObject(Object obj,
ContextManager contextManager,
ContextInjector contextInjector)
Configures the specified object.
|
static Context |
createFixedContext(Collection<?> content)
Creates a context with a fixed content.
|
static Context |
emptyContext()
Returns an immutable empty
Context . |
static <T> T |
find(Object localContextProvider,
Class<T> type)
Finds an instance of the specified type in the local context of the provided
LocalContextProvider . |
static Context |
getLocalContext(Object localContextProvider)
Gets the local
Context of a LocalContextProvider . |
public static Context emptyContext()
Context
.public static Context getLocalContext(Object localContextProvider)
Context
of a LocalContextProvider
.localContextProvider
- a LocalContextProviderClassCastException
- if localContextProvider does not implement LocalContextProviderpublic static <T> T find(Object localContextProvider, Class<T> type)
LocalContextProvider
. If the local context has more than one instance of the specified type, the first one
found will be returned.T
- the specified typelocalContextProvider
- a LocalContextProvidertype
- the specified typenull
if no instance was found or if localContextProvider does not implement LocalContextProvider.public static Context createFixedContext(Collection<?> content)
content
- the contentpublic static void configureObject(Object obj, ContextManager contextManager, ContextInjector contextInjector)
obj
- the objectcontextManager
- the context managercontextInjector
- the context injectorContextManager.registerLocalContext(java.lang.Object)
,
ContextInjector.inject(java.lang.Object)
Copyright © 2012–2019 Drombler. All rights reserved.