Package proguard.evaluation
Class ExecutingInvocationUnit.Builder
- java.lang.Object
-
- proguard.evaluation.ExecutingInvocationUnit.Builder
-
- Enclosing class:
- ExecutingInvocationUnit
public static class ExecutingInvocationUnit.Builder extends java.lang.ObjectBuilds anExecutingInvocationUnit.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanenableSameInstanceIdApproximationprotected java.util.List<Executor.Builder<?>>registeredExecutorBuildersprotected booleanuseDefaultStringReflectionExecutor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutingInvocationUnit.BuilderaddExecutor(Executor.Builder<?> executor)Add anExecutorto be considered by theExecutingInvocationUnitwhen trying to analyze a method call.ExecutingInvocationUnit.BuilderaddExecutors(Executor.Builder<?>... executors)Add multipleExecutors to be considered by theExecutingInvocationUnitwhen trying to analyze a method call.ExecutingInvocationUnitbuild(ValueFactory valueFactory)Build theExecutingInvocationUnitdefined by this builder instance.ExecutingInvocationUnitbuildWithoutDefaults(ValueFactory valueFactory)Build theExecutingInvocationUnitdefined by this builder instance, do not add the default executor even if otherwise specified.ExecutingInvocationUnit.BuildersetAllowNonFinalConstants(boolean allowNonFinalConstants)By default, the ExecutingInvocationUnit will read constant value attributes from static final fields.ExecutingInvocationUnit.BuildersetEnableSameInstanceIdApproximation(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.BuilderuseDefaultStringReflectionExecutor(boolean useDefaultStringReflectionExecutor)Set this flag to false if theExecutingInvocationUnitshould not useStringReflectionExecutorby 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.
-
setAllowNonFinalConstants
public ExecutingInvocationUnit.Builder setAllowNonFinalConstants(boolean allowNonFinalConstants)
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
public ExecutingInvocationUnit.Builder addExecutor(Executor.Builder<?> executor)
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
public ExecutingInvocationUnit.Builder addExecutors(Executor.Builder<?>... executors)
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
public ExecutingInvocationUnit build(ValueFactory valueFactory)
Build theExecutingInvocationUnitdefined by this builder instance.- Parameters:
valueFactory- TheValueFactoryresponsible for creating result values.- Returns:
- The built
ExecutingInvocationUnit
-
buildWithoutDefaults
public ExecutingInvocationUnit buildWithoutDefaults(ValueFactory valueFactory)
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
-
-