| Package | Description |
|---|---|
| net.lecousin.framework.injection |
Dependency injection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
InjectionContext.add(ObjectProvider provider)
Add an object provider.
|
static Object |
Injection.create(InjectionContext ctx,
Class<?> clazz,
ObjectMethod initMethod,
List<ObjectAttribute> attrs)
Create an object to be injected.
|
static <T> T |
Injection.create(InjectionContext ctx,
Class<T> clazz,
List<ObjectValue> params,
ObjectMethod initMethod,
List<ObjectAttribute> attrs)
Create an object to be injected.
|
<T> T |
ObjectValueRefType.create(InjectionContext ctx,
Class<T> type,
Type genericType,
Annotation[] annotations) |
<T> T |
ObjectValueRefId.create(InjectionContext ctx,
Class<T> type,
Type genericType,
Annotation[] annotations) |
<T> T |
ObjectValueMap.create(InjectionContext ctx,
Class<T> type,
Type genericType,
Annotation[] annotations) |
<T> T |
ObjectValueList.create(InjectionContext ctx,
Class<T> type,
Type genericType,
Annotation[] annotations) |
<T> T |
ObjectValueFromString.create(InjectionContext ctx,
Class<T> type,
Type genericType,
Annotation[] annotations) |
<T> T |
ObjectValueFromSingletonAttribute.create(InjectionContext ctx,
Class<T> type,
Type genericType,
Annotation[] annotations) |
<T> T |
ObjectValueClass.create(InjectionContext ctx,
Class<T> type,
Type genericType,
Annotation[] annotations) |
<T> T |
ObjectValue.create(InjectionContext ctx,
Class<T> type,
Type genericType,
Annotation[] annotations)
Create the object based on the given context.
|
static <T> T |
Injection.createObjectFromString(Class<T> type,
Type genericType,
String value,
Annotation[] annotations)
Create an object from a string value.
|
protected Object |
ObjectValueFromSingletonAttributeByType.getInstance(InjectionContext ctx) |
protected Object |
ObjectValueFromSingletonAttributeById.getInstance(InjectionContext ctx) |
protected abstract Object |
ObjectValueFromSingletonAttribute.getInstance(InjectionContext ctx) |
<T> T |
InjectionContext.getObject(Class<T> type)
Retrieve an object by its implemented type.
|
Object |
InjectionContext.getObjectById(String id)
Retrieve an object by its id.
|
<T> T |
InjectionContext.getObjectById(String id,
Class<T> type)
Retrieve an object by its id and implemented type.
|
static void |
Injection.inject(InjectionContext ctx,
Object instance)
Perform injection on the instance, by looking for fields having the Inject annotation.
|
static void |
Injection.injectAttribute(InjectionContext ctx,
Object instance,
ObjectAttribute attribute)
Inject the given attribute in the instance.
|
abstract Object |
ObjectProvider.provide()
Provide an object for injection.
|
Object |
Factory.provide() |
Object |
InjectionContext.searchObjectInChildren(String id)
Search an object by ID in this context and its descendents.
|
void |
InjectionContext.setObject(String id,
Class<?> type,
Object instance,
ObjectMethod destroy)
Add a singleton by id, equivalent to call
add(new Singleton(type, instance, id)). |
Copyright © 2018. All rights reserved.