Package proguard.evaluation
Class ExecutingInvocationUnit.Builder
- java.lang.Object
-
- proguard.evaluation.ExecutingInvocationUnit.Builder
-
- Enclosing class:
- ExecutingInvocationUnit
public static class ExecutingInvocationUnit.Builder extends java.lang.Object
Builds anExecutingInvocationUnit
.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
enableSameInstanceIdApproximation
protected java.util.List<Executor.Builder<?>>
registeredExecutorBuilders
protected boolean
useDefaultStringReflectionExecutor
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutingInvocationUnit.Builder
addExecutor(Executor.Builder<?> executor)
Add anExecutor
to be considered by theExecutingInvocationUnit
when trying to analyze a method call.ExecutingInvocationUnit.Builder
addExecutors(Executor.Builder<?>... executors)
Add multipleExecutor
s to be considered by theExecutingInvocationUnit
when trying to analyze a method call.ExecutingInvocationUnit
build(ValueFactory valueFactory, @Nullable ClassPool libraryClassPool)
Build theExecutingInvocationUnit
defined by this builder instance.ExecutingInvocationUnit
buildWithoutDefaults(ValueFactory valueFactory)
Build theExecutingInvocationUnit
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 theExecutingInvocationUnit
should not useStringReflectionExecutor
by default.
-
-
-
Field Detail
-
enableSameInstanceIdApproximation
protected boolean enableSameInstanceIdApproximation
-
useDefaultStringReflectionExecutor
protected boolean useDefaultStringReflectionExecutor
-
registeredExecutorBuilders
protected java.util.List<Executor.Builder<?>> registeredExecutorBuilders
-
-
Method Detail
-
setEnableSameInstanceIdApproximation
public 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. In such a case, setting this flag to true will result in no new ID being created for the return value.- Parameters:
enableSameInstanceIdApproximation
- whether the approximation should be enabled.
-
addExecutor
public ExecutingInvocationUnit.Builder addExecutor(Executor.Builder<?> executor)
Add anExecutor
to be considered by theExecutingInvocationUnit
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 tofalse
the defaultStringReflectionExecutor
has the highest priority.- Parameters:
executor
- AExecutor.Builder
of theExecutor
to be added.
-
addExecutors
public ExecutingInvocationUnit.Builder addExecutors(Executor.Builder<?>... executors)
Add multipleExecutor
s to be considered by theExecutingInvocationUnit
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 tofalse
the defaultStringReflectionExecutor
has the highest priority.- Parameters:
executors
-Executor.Builder
s of theExecutor
s to be added.
-
useDefaultStringReflectionExecutor
public ExecutingInvocationUnit.Builder useDefaultStringReflectionExecutor(boolean useDefaultStringReflectionExecutor)
Set this flag to false if theExecutingInvocationUnit
should not useStringReflectionExecutor
by default.- Parameters:
useDefaultStringReflectionExecutor
- whether a defaultStringReflectionExecutor
should be used.
-
build
public ExecutingInvocationUnit build(ValueFactory valueFactory, @Nullable @Nullable ClassPool libraryClassPool)
Build theExecutingInvocationUnit
defined by this builder instance.- Parameters:
valueFactory
- TheValueFactory
responsible for creating result values.libraryClassPool
- The library class pool. Can be null if `useDefaultStringReflectionExecutor` is set to false.- Returns:
- The built
ExecutingInvocationUnit
-
buildWithoutDefaults
public ExecutingInvocationUnit buildWithoutDefaults(ValueFactory valueFactory)
Build theExecutingInvocationUnit
defined by this builder instance, do not add the default executor even if otherwise specified.- Parameters:
valueFactory
- TheValueFactory
responsible for creating result values.- Returns:
- The built
ExecutingInvocationUnit
-
-