| Package | Description |
|---|---|
| net.lecousin.framework.injection |
Dependency injection.
|
| net.lecousin.framework.injection.xml |
Parsing injection configuration from XML.
|
| Modifier and Type | Field and Description |
|---|---|
protected InjectionContext |
ObjectProvider.ctx |
| Modifier and Type | Method and Description |
|---|---|
InjectionContext |
InjectionContext.getParent() |
static InjectionContext |
InjectionContext.getRoot() |
| Modifier and Type | Method and Description |
|---|---|
static void |
Injection.call(InjectionContext ctx,
Object instance,
ObjectMethod method)
Call a method on an instance.
|
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.
|
protected Object |
ObjectValueFromSingletonAttributeByType.getInstance(InjectionContext ctx) |
protected Object |
ObjectValueFromSingletonAttributeById.getInstance(InjectionContext ctx) |
protected abstract Object |
ObjectValueFromSingletonAttribute.getInstance(InjectionContext ctx) |
static String |
Injection.getProperty(net.lecousin.framework.application.Application app,
InjectionContext ctx,
String name)
Search a property first in the context, then in the application.
|
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.
|
static String |
Injection.resolveProperties(InjectionContext ctx,
net.lecousin.framework.application.Application app,
CharSequence value)
Resolve properties in the given value.
|
static String |
Injection.resolveProperties(InjectionContext ctx,
net.lecousin.framework.application.Application app,
String value)
Resolve properties in the given value.
|
static void |
Injection.scanPackage(InjectionContext ctx,
net.lecousin.framework.application.Application app,
String pkgName,
boolean singletons)
Scan a package to find injectable objects.
|
void |
InjectionContext.setParent(InjectionContext parent)
Set the parent context, and add this context to the children of the given parent.
|
| Constructor and Description |
|---|
Factory(InjectionContext ctx,
Class<?> baseType,
Class<?> implType,
ObjectMethod initMethod,
List<ObjectAttribute> attributes,
String id)
Constructor.
|
InjectionContext(InjectionContext parent)
Constructor.
|
InjectionSerializationRule(InjectionContext context)
Constructor.
|
ObjectProvider(InjectionContext ctx,
Class<?> type,
String id)
Constructor.
|
Singleton(InjectionContext ctx,
Class<?> type,
Object instance,
String id,
ObjectMethod destroy)
Constructor.
|
SingletonOnDemand(InjectionContext ctx,
Class<?> type,
net.lecousin.framework.util.Provider<?> provider,
String id,
ObjectMethod destroy)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static net.lecousin.framework.concurrent.synch.ISynchronizationPoint<Exception> |
InjectionXmlConfiguration.configure(InjectionContext ctx,
net.lecousin.framework.io.IO.Readable xml)
Configure the given InjectionContext with the XML file.
|
static net.lecousin.framework.concurrent.synch.ISynchronizationPoint<Exception> |
InjectionXmlConfiguration.configure(InjectionContext ctx,
String filename)
Configure the given InjectionContext with the XML file.
|
void |
InjectionXmlParser01.configureInjection(InjectionContext ctx,
net.lecousin.framework.xml.XMLStreamReader xml) |
void |
InjectionXmlParser.configureInjection(InjectionContext ctx,
net.lecousin.framework.xml.XMLStreamReader xml)
Entry-point of the parser.
|
static void |
InjectionXmlConfiguration.configureInjection(InjectionContext ctx,
net.lecousin.framework.xml.XMLStreamReader xml)
Configure the given context with the given XML which must be on an Injection element.
|
static ObjectAttribute |
InjectionXmlParser01.readObjectAttribute(InjectionContext ctx,
net.lecousin.framework.xml.XMLStreamReader xml,
net.lecousin.framework.application.Application app)
Read an attribute from the given XML which must be on the attribute element.
|
static ObjectMethod |
InjectionXmlParser01.readObjectMethod(InjectionContext ctx,
net.lecousin.framework.xml.XMLStreamReader xml,
net.lecousin.framework.application.Application app)
Read an object method from an XML stream.
|
static ObjectValue |
InjectionXmlParser01.readObjectValue(InjectionContext ctx,
net.lecousin.framework.xml.XMLStreamReader xml,
net.lecousin.framework.application.Application app)
Read an ObjectValue from the given XML.
|
Copyright © 2018. All rights reserved.