public interface DynamicContext
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getException()
Returns the exception reference when applyed in @After or @AfterThrowing,
null otherwise.
|
<T> T |
getLocalVariableValue(int index,
java.lang.Class<T> valueType)
Returns value of local variable with given index at runtime.
|
<T> T |
getMethodArgumentValue(int index,
java.lang.Class<T> valueType)
Returns value of method argument at given position at runtime.
|
<T> T |
getStackValue(int distance,
java.lang.Class<T> valueType)
Returns value on application stack at runtime.
|
java.lang.Object |
getThis()
Returns reference to this object for dynamic method, null for static
method.
|
<T> T getStackValue(int distance, java.lang.Class<T> valueType)
distance
- position from the top of the stack.
0 returns top of the stack.
Doubles and longs are counted as distance difference 1.valueType
- type of the accessed value<T> T getLocalVariableValue(int index, java.lang.Class<T> valueType)
index
- argument position.
You have to know the exact index of the accessed local variable.
Doubles and longs are counted as distance difference 2.valueType
- type of the accessed argumentjava.lang.Object getThis()
<T> T getMethodArgumentValue(int index, java.lang.Class<T> valueType)
index
- argument position.
0 returns first argument.
Doubles and longs are counted as distance difference 1.valueType
- type of the accessed argumentjava.lang.Throwable getException()