|
||||||||||
| 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 java.lang.Object |
injectInto(java.lang.Object objectToInject,
java.lang.Object target,
java.lang.String property)
Explicit injection of the objectToInject into the specified property of the target. |
static void |
injectIntoAnnotated(java.lang.Object objectToInject,
java.lang.Object target,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
|
static void |
injectIntoAnnotatedFields(java.lang.Object objectToInject,
java.lang.Object target,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
|
static void |
injectIntoAnnotatedMethods(java.lang.Object objectToInject,
java.lang.Object target,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
|
static java.lang.Object |
injectIntoByType(java.lang.Object objectToInject,
java.lang.reflect.Type objectToInjectType,
java.lang.Object target,
PropertyAccess propertyAccess)
Performs auto-injection by type of the objectToInject on the target object. |
static java.lang.Object |
injectIntoStatic(java.lang.Object objectToInject,
java.lang.Class<?> targetClass,
java.lang.String property)
Explicit injection of the objectToInject into the specified static property of the target class. |
static java.lang.Object |
injectIntoStaticByType(java.lang.Object objectToInject,
java.lang.reflect.Type objectToInjectType,
java.lang.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 java.lang.Object injectInto(java.lang.Object objectToInject,
java.lang.Object target,
java.lang.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 java.lang.Object injectIntoStatic(java.lang.Object objectToInject,
java.lang.Class<?> targetClass,
java.lang.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 java.lang.Object injectIntoByType(java.lang.Object objectToInject,
java.lang.reflect.Type objectToInjectType,
java.lang.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 java.lang.Object injectIntoStaticByType(java.lang.Object objectToInject,
java.lang.reflect.Type objectToInjectType,
java.lang.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(java.lang.Object objectToInject,
java.lang.Object target,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
public static void injectIntoAnnotatedMethods(java.lang.Object objectToInject,
java.lang.Object target,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
public static void injectIntoAnnotatedFields(java.lang.Object objectToInject,
java.lang.Object target,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||