public static class ExecutingInvocationUnit.Builder
extends java.lang.Object
ExecutingInvocationUnit
.Modifier and Type | Field and Description |
---|---|
protected boolean |
enableSameInstanceIdApproximation |
protected java.util.List<Executor.Builder<?>> |
registeredExecutorBuilders |
protected boolean |
useDefaultStringReflectionExecutor |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ExecutingInvocationUnit.Builder |
addExecutor(Executor.Builder<?> executor)
Add an
Executor to be considered by the ExecutingInvocationUnit when trying
to analyze a method call. |
ExecutingInvocationUnit.Builder |
addExecutors(Executor.Builder<?>... executors)
Add multiple
Executor s to be considered by the ExecutingInvocationUnit when
trying to analyze a method call. |
ExecutingInvocationUnit |
build(ValueFactory valueFactory,
@Nullable ClassPool libraryClassPool)
Build the
ExecutingInvocationUnit defined by this builder instance. |
ExecutingInvocationUnit |
buildWithoutDefaults(ValueFactory valueFactory)
Build the
ExecutingInvocationUnit defined by this builder instance, do not add the
default executor even if otherwise specified. |
ExecutingInvocationUnit.Builder |
setEnableSameInstanceIdApproximation(boolean enableSameInstanceIdApproximation)
For methods that are not supported by any executor, decide, whether a method with matching
return and instance types should be treated as a method which returns its instance.
|
ExecutingInvocationUnit.Builder |
useDefaultStringReflectionExecutor(boolean useDefaultStringReflectionExecutor)
Set this flag to false if the
ExecutingInvocationUnit should not use StringReflectionExecutor by default. |
protected boolean enableSameInstanceIdApproximation
protected boolean useDefaultStringReflectionExecutor
protected java.util.List<Executor.Builder<?>> registeredExecutorBuilders
public ExecutingInvocationUnit.Builder setEnableSameInstanceIdApproximation(boolean enableSameInstanceIdApproximation)
enableSameInstanceIdApproximation
- whether the approximation should be enabled.public ExecutingInvocationUnit.Builder addExecutor(Executor.Builder<?> executor)
Executor
to be considered by the ExecutingInvocationUnit
when trying
to analyze a method call.
N.B.: If a method is supported by different executors the first one added gets priority.
If useDefaultStringReflectionExecutor(boolean)
is not set to false
the default StringReflectionExecutor
has the highest
priority.
executor
- A Executor.Builder
of the Executor
to be added.public ExecutingInvocationUnit.Builder addExecutors(Executor.Builder<?>... executors)
Executor
s to be considered by the ExecutingInvocationUnit
when
trying to analyze a method call.
N.B.: If a method is supported by different executors the first one added gets priority.
If useDefaultStringReflectionExecutor(boolean)
is not set to false
the default StringReflectionExecutor
has the highest
priority.
executors
- Executor.Builder
s of the Executor
s to be added.public ExecutingInvocationUnit.Builder useDefaultStringReflectionExecutor(boolean useDefaultStringReflectionExecutor)
ExecutingInvocationUnit
should not use StringReflectionExecutor
by default.useDefaultStringReflectionExecutor
- whether a default StringReflectionExecutor
should be used.public ExecutingInvocationUnit build(ValueFactory valueFactory, @Nullable @Nullable ClassPool libraryClassPool)
ExecutingInvocationUnit
defined by this builder instance.valueFactory
- The ValueFactory
responsible for creating result values.libraryClassPool
- The library class pool. Can be null if
`useDefaultStringReflectionExecutor` is set to false.ExecutingInvocationUnit
public ExecutingInvocationUnit buildWithoutDefaults(ValueFactory valueFactory)
ExecutingInvocationUnit
defined by this builder instance, do not add the
default executor even if otherwise specified.valueFactory
- The ValueFactory
responsible for creating result values.ExecutingInvocationUnit