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(@NotNull ClassPool programClassPool,
@NotNull ClassPool libraryClassPool) |
| 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
Executors to be considered by the ExecutingInvocationUnit when
trying to analyze a method call. |
ExecutingInvocationUnit |
build(ValueFactory valueFactory)
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 |
setAllowNonFinalConstants(boolean allowNonFinalConstants)
By default, the ExecutingInvocationUnit will read constant value attributes from static final
fields.
|
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 setAllowNonFinalConstants(boolean allowNonFinalConstants)
allowNonFinalConstants - whether reading from non-final constants 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)
Executors 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.Builders of the Executors 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)
ExecutingInvocationUnit defined by this builder instance.valueFactory - The ValueFactory responsible for creating result values.ExecutingInvocationUnitpublic 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