|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.inject.util.InjectionUtils
public class InjectionUtils
Class containing static methods that implement explicit injection using OGNL expressions, and auto-injection by type.
| Constructor Summary | |
|---|---|
InjectionUtils()
|
|
| Method Summary | |
|---|---|
static Object |
injectInto(Object objectToInject,
Object target,
String property)
Explicit injection of the objectToInject into the specified property of the target. |
static void |
injectIntoAnnotated(Object objectToInject,
Object target,
Class<? extends Annotation> annotation)
|
static void |
injectIntoAnnotatedFields(Object objectToInject,
Object target,
Class<? extends Annotation> annotation)
|
static void |
injectIntoAnnotatedMethods(Object objectToInject,
Object target,
Class<? extends Annotation> annotation)
|
static Object |
injectIntoByType(Object objectToInject,
Type objectToInjectType,
Object target,
PropertyAccess propertyAccess)
Performs auto-injection by type of the objectToInject on the target object. |
static Object |
injectIntoStatic(Object objectToInject,
Class<?> targetClass,
String property)
Explicit injection of the objectToInject into the specified static property of the target class. |
static Object |
injectIntoStaticByType(Object objectToInject,
Type objectToInjectType,
Class<?> targetClass,
PropertyAccess propertyAccess)
Performs auto-injection by type of the objectToInject into the target class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InjectionUtils()
| Method Detail |
|---|
public static Object injectInto(Object objectToInject,
Object target,
String property)
objectToInject - The object that is injectedtarget - The target objectproperty - The OGNL expression that defines where the object will be injected, not null
public static Object injectIntoStatic(Object objectToInject,
Class<?> targetClass,
String property)
objectToInject - The object that is injectedtargetClass - The target class, not nullproperty - The OGNL expression that defines where the object will be injected, not null
public static Object injectIntoByType(Object objectToInject,
Type objectToInjectType,
Object target,
PropertyAccess propertyAccess)
objectToInject - The object that is injectedobjectToInjectType - The type of the object. This should be the type of the object or one of his super-types
or implemented interfaces. This type is used for property type matching on the target objecttarget - The object into which the objectToInject is injectedpropertyAccess - Defines if field or setter injection is used
public static Object injectIntoStaticByType(Object objectToInject,
Type objectToInjectType,
Class<?> targetClass,
PropertyAccess propertyAccess)
objectToInject - The object that is injectedobjectToInjectType - The type of the object. This should be the type of the object or one of his super-types
or implemented interfaces. This type is used for property type matching on the target classtargetClass - The class into which the objectToInject is injectedpropertyAccess - Defines if field or setter injection is used
public static void injectIntoAnnotated(Object objectToInject,
Object target,
Class<? extends Annotation> annotation)
public static void injectIntoAnnotatedMethods(Object objectToInject,
Object target,
Class<? extends Annotation> annotation)
public static void injectIntoAnnotatedFields(Object objectToInject,
Object target,
Class<? extends Annotation> annotation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||