T - the injection typepublic final class MethodInjector<T> extends java.lang.Object implements Injector<T>
Values.injectedValue(). The
value being invoked upon can be specified by Values.thisValue().| Modifier and Type | Field and Description |
|---|---|
private Value<?> |
injectedValue |
private java.lang.reflect.Method |
method |
private java.util.List<? extends Value<?>> |
parameterList |
private Value<?> |
targetValue |
| Constructor and Description |
|---|
MethodInjector(java.lang.reflect.Method method,
Value<?> targetValue,
Value<?> injectedValue,
java.util.List<? extends Value<?>> parameterList)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
inject(T value)
Inject the given value.
|
void |
uninject()
Uninject the given value (in other words, cancel or undo a previous injection).
|
private final java.lang.reflect.Method method
private final Value<?> injectedValue
private final Value<?> targetValue
private final java.util.List<? extends Value<?>> parameterList
public MethodInjector(java.lang.reflect.Method method,
Value<?> targetValue,
Value<?> injectedValue,
java.util.List<? extends Value<?>> parameterList)
method - the method to invoketargetValue - the value of the invocation target (the object being called upon) - use Values.nullValue() for static methodsinjectedValue - the value to use for Values.injectedValue() on uninjection (usually Values.nullValue())parameterList - the list of parameter values (any null parameters should use Values.nullValue())public void inject(T value) throws InjectionException
inject in interface Injector<T>value - the valueInjectionException - if the injection failed