public class InjectionContext extends Object
| Constructor and Description |
|---|
InjectionContext()
Constructor.
|
InjectionContext(InjectionContext parent)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(ObjectProvider provider)
Add an object provider.
|
<T> T |
getObject(Class<T> type)
Retrieve an object by its implemented type.
|
Object |
getObjectById(String id)
Retrieve an object by its id.
|
<T> T |
getObjectById(String id,
Class<T> type)
Retrieve an object by its id and implemented type.
|
InjectionContext |
getParent() |
String |
getProperty(String name)
Return a property or null if not set.
|
void |
setParent(InjectionContext parent) |
void |
setProperty(String name,
String value)
Set a property.
|
public InjectionContext(InjectionContext parent)
public InjectionContext()
public InjectionContext getParent()
public void setParent(InjectionContext parent)
public Object getObjectById(String id) throws InjectionException
InjectionExceptionpublic <T> T getObjectById(String id, Class<T> type) throws InjectionException
InjectionExceptionpublic <T> T getObject(Class<T> type) throws InjectionException
InjectionExceptionpublic void add(ObjectProvider provider) throws InjectionException
InjectionExceptionCopyright © 2018. All rights reserved.