public final class Injection extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
call(Object instance,
ObjectMethod method)
Call a method on an instance.
|
static Object |
create(InjectionContext ctx,
Class<?> clazz,
List<String> params,
ObjectMethod initMethod,
List<ObjectAttribute> attrs)
Create an object to be injected.
|
static Object |
create(InjectionContext ctx,
Class<?> clazz,
ObjectMethod initMethod,
List<ObjectAttribute> attrs)
Create an object to be injected.
|
static Object |
createObjectFromString(Class<?> type,
Type genericType,
String value,
Annotation[] annotations)
Create an object from a string value.
|
static String |
getProperty(net.lecousin.framework.application.Application app,
InjectionContext ctx,
String name)
Search a property first in the context, then in the application.
|
static void |
inject(InjectionContext ctx,
Object instance)
Perform injection on the instance, by looking for fields having the Inject annotation.
|
static void |
injectAttribute(InjectionContext ctx,
Object instance,
ObjectAttribute attribute)
Inject the given attribute in the instance.
|
static String |
resolveProperties(InjectionContext ctx,
net.lecousin.framework.application.Application app,
CharSequence value)
Resolve properties in the given value.
|
static String |
resolveProperties(InjectionContext ctx,
net.lecousin.framework.application.Application app,
String value)
Resolve properties in the given value.
|
static void |
scanPackage(InjectionContext ctx,
net.lecousin.framework.application.Application app,
String pkgName,
boolean singletons)
Scan a package to find injectable objects.
|
public static String getProperty(net.lecousin.framework.application.Application app, InjectionContext ctx, String name)
public static Object create(InjectionContext ctx, Class<?> clazz, ObjectMethod initMethod, List<ObjectAttribute> attrs) throws InjectionException
InjectionExceptionpublic static Object create(InjectionContext ctx, Class<?> clazz, List<String> params, ObjectMethod initMethod, List<ObjectAttribute> attrs) throws InjectionException
InjectionExceptionpublic static Object createObjectFromString(Class<?> type, Type genericType, String value, Annotation[] annotations) throws InjectionException
InjectionExceptionpublic static void injectAttribute(InjectionContext ctx, Object instance, ObjectAttribute attribute) throws InjectionException
InjectionExceptionpublic static void inject(InjectionContext ctx, Object instance) throws InjectionException
InjectionExceptionpublic static void call(Object instance, ObjectMethod method) throws Exception
Exceptionpublic static String resolveProperties(InjectionContext ctx, net.lecousin.framework.application.Application app, String value)
public static String resolveProperties(InjectionContext ctx, net.lecousin.framework.application.Application app, CharSequence value)
public static void scanPackage(InjectionContext ctx, net.lecousin.framework.application.Application app, String pkgName, boolean singletons) throws Exception
ExceptionCopyright © 2018. All rights reserved.