Package proguard.evaluation
Class ExecutingInvocationUnit.Builder
java.lang.Object
proguard.evaluation.ExecutingInvocationUnit.Builder
- Enclosing class:
- ExecutingInvocationUnit
Builds an
ExecutingInvocationUnit.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected List<Executor.Builder<?>>protected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExecutor(Executor.Builder<?> executor) Add anExecutorto be considered by theExecutingInvocationUnitwhen trying to analyze a method call.addExecutors(Executor.Builder<?>... executors) Add multipleExecutors to be considered by theExecutingInvocationUnitwhen trying to analyze a method call.build(ValueFactory valueFactory) Build theExecutingInvocationUnitdefined by this builder instance.buildWithoutDefaults(ValueFactory valueFactory) Build theExecutingInvocationUnitdefined by this builder instance, do not add the default executor even if otherwise specified.setAllowNonFinalConstants(boolean allowNonFinalConstants) By default, the ExecutingInvocationUnit will read constant value attributes from static final fields.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.useDefaultStringReflectionExecutor(boolean useDefaultStringReflectionExecutor) Set this flag to false if theExecutingInvocationUnitshould not useStringReflectionExecutorby default.
-
Field Details
-
enableSameInstanceIdApproximation
protected boolean enableSameInstanceIdApproximation -
useDefaultStringReflectionExecutor
protected boolean useDefaultStringReflectionExecutor -
registeredExecutorBuilders
-
-
Constructor Details
-
Builder
-
-
Method Details
-
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.
-
setAllowNonFinalConstants
By default, the ExecutingInvocationUnit will read constant value attributes from static final fields. This method allows for reading constant value attributes from non-final static fields as well.- Parameters:
allowNonFinalConstants- whether reading from non-final constants should be enabled.
-
addExecutor
Add anExecutorto be considered by theExecutingInvocationUnitwhen 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 tofalsethe defaultStringReflectionExecutorhas the highest priority.- Parameters:
executor- AExecutor.Builderof theExecutorto be added.
-
addExecutors
Add multipleExecutors to be considered by theExecutingInvocationUnitwhen 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 tofalsethe defaultStringReflectionExecutorhas the highest priority.- Parameters:
executors-Executor.Builders of theExecutors to be added.
-
useDefaultStringReflectionExecutor
public ExecutingInvocationUnit.Builder useDefaultStringReflectionExecutor(boolean useDefaultStringReflectionExecutor) Set this flag to false if theExecutingInvocationUnitshould not useStringReflectionExecutorby default.- Parameters:
useDefaultStringReflectionExecutor- whether a defaultStringReflectionExecutorshould be used.
-
build
Build theExecutingInvocationUnitdefined by this builder instance.- Parameters:
valueFactory- TheValueFactoryresponsible for creating result values.- Returns:
- The built
ExecutingInvocationUnit
-
buildWithoutDefaults
Build theExecutingInvocationUnitdefined by this builder instance, do not add the default executor even if otherwise specified.- Parameters:
valueFactory- TheValueFactoryresponsible for creating result values.- Returns:
- The built
ExecutingInvocationUnit
-