public interface Executor
ExecutingInvocationUnit
in order to extend its capabilities. An Executor
specifies which
method calls it supports, what methods return their own instance and how a method result is
calculated.Modifier and Type | Interface and Description |
---|---|
static interface |
Executor.Builder<T extends Executor>
A builder for the executor.
|
Modifier and Type | Method and Description |
---|---|
ExecutorMatcher |
getExecutorMatcher()
Get a matcher telling if the executor should be used to execute a certain method.
|
MethodResult |
getMethodResult(MethodExecutionInfo methodData,
ValueCalculator valueCalculator)
Calculate the result of a given method.
|
default boolean |
isSupportedMethodCall(MethodSignature signature)
Returns whether a certain method invocation is supported.
|
MethodResult getMethodResult(MethodExecutionInfo methodData, ValueCalculator valueCalculator)
methodData
- Information about the called method.valueCalculator
- a function mapping the result of a method invocation (can be an Object
with the result if the executor calculates a real value or a Model
) to the appropriate Value
used by the
analysis. Should also be used to create values of unknown value since the executor might be
able to provide additional information on them even if the value itself is not known (e.g.,
on the identifier of the returned value).MethodResult.invalidResult()
, so that the caller can know that execution failed and
just provide its best approximation of the result.default boolean isSupportedMethodCall(MethodSignature signature)
signature
- The method signature.ExecutorMatcher getExecutorMatcher()