org.test4j.module.inject.utility
类 InjectionModuleHelper
java.lang.Object
org.test4j.module.inject.utility.InjectionModuleHelper
public class InjectionModuleHelper
- extends Object
Class containing static methods that implement explicit injection using OGNL
expressions, and auto-injection by type.
|
方法摘要 |
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)
Performs auto-injection by type of the objectToInject on the target
object. |
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InjectionModuleHelper
public InjectionModuleHelper()
injectInto
public static Object injectInto(Object objectToInject,
Object target,
String property)
- Explicit injection of the objectToInject into the specified property of
the target. The property should be a correct OGNL expression.
- 参数:
objectToInject - The object that is injectedtarget - The target objectproperty - The OGNL expression that defines where the object will be
injected, not null
- 返回:
- The object that was replaced by the injection
injectIntoByType
public static Object injectIntoByType(Object objectToInject,
Type objectToInjectType,
Object target)
- Performs auto-injection by type of the objectToInject on the target
object.
- 参数:
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
- 返回:
- The object that was replaced by the injection
injectIntoAnnotated
public static void injectIntoAnnotated(Object objectToInject,
Object target,
Class<? extends Annotation> annotation)
injectIntoAnnotatedMethods
public static void injectIntoAnnotatedMethods(Object objectToInject,
Object target,
Class<? extends Annotation> annotation)
injectIntoAnnotatedFields
public static void injectIntoAnnotatedFields(Object objectToInject,
Object target,
Class<? extends Annotation> annotation)
Copyright © 2013. All rights reserved.