public class InjectionUtils extends Object
| Constructor and Description |
|---|
InjectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 nullpublic 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 nullpublic 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 usedpublic 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 usedpublic 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)
Copyright © 2016. All Rights Reserved.