类 ReflectiveModelExecutor
- java.lang.Object
-
- proguard.evaluation.executor.ReflectiveModelExecutor
-
- 所有已实现的接口:
Executor
public class ReflectiveModelExecutor extends java.lang.Object implements Executor
AnExecutorwith support forReflectiveModels.Checks the parameters sanity so that the models can work assuming they get clean data and matches the target
ReflectiveModeland executes the method on it via the reflection supported byModelHelper.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classReflectiveModelExecutor.BuilderBuilder forReflectiveModelExecutor.static classReflectiveModelExecutor.SupportedModelInfo<T extends ReflectiveModel<T>>Information provided by an executor to communicate which classes it supports.
-
字段概要
字段 修饰符和类型 字段 说明 protected java.util.Set<ReflectiveModelExecutor.SupportedModelInfo<? extends ReflectiveModel<?>>>supportedModelsprotected java.util.Set<MethodSignature>supportedSignaturesprotected java.util.Map<MethodSignature,java.lang.Class<? extends ReflectiveModel<?>>>supportedSignatureToModel
-
构造器概要
构造器 限定符 构造器 说明 protectedReflectiveModelExecutor(java.util.Set<ReflectiveModelExecutor.SupportedModelInfo<?>> supportedModels, HierarchyProvider hierarchy)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static <T extends ReflectiveModel<T>>
java.util.Set<MethodSignature>generateMethodSignaturesForModel(ReflectiveModelExecutor.SupportedModelInfo<T> modelInfo, HierarchyProvider hierarchy)Computes the methods the executor needs to support for the specified classes.MethodResultgetMethodResult(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator)Calculate the result of a given method.java.util.Set<MethodSignature>getSupportedMethodSignatures()Get a list of method signatures that indicate which methods are supported by this executor.
-
-
-
字段详细资料
-
supportedModels
protected final java.util.Set<ReflectiveModelExecutor.SupportedModelInfo<? extends ReflectiveModel<?>>> supportedModels
-
supportedSignatures
protected final java.util.Set<MethodSignature> supportedSignatures
-
supportedSignatureToModel
protected final java.util.Map<MethodSignature,java.lang.Class<? extends ReflectiveModel<?>>> supportedSignatureToModel
-
-
构造器详细资料
-
ReflectiveModelExecutor
protected ReflectiveModelExecutor(java.util.Set<ReflectiveModelExecutor.SupportedModelInfo<?>> supportedModels, HierarchyProvider hierarchy)
-
-
方法详细资料
-
getMethodResult
public MethodResult getMethodResult(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator)
从接口复制的说明:ExecutorCalculate the result of a given method. This is the return value for a non-constructor method (null if it returnsvoid ) and the instantiated object for a constructor.- 指定者:
getMethodResult在接口中Executor- 参数:
methodExecutionInfo- Information about the called method.valueCalculator- a function mapping the result of a method invocation (can be an Object with the result if the executor calculates a real value or aModel) to the appropriateValueused by the analysis. Should also be used to create values of unknown value since the executor might be able to provide additional information on them even if the value itself is not known (e.g., on the identifier of the returned value).- 返回:
- The result of the method call, including information on the returned value or values or
arguments on which side effects happened during the method execution. If the executor is
not able to provide any additional information for any reason the returned value should be
MethodResult.invalidResult(), so that the caller can know that execution failed and just provide its best approximation of the result.
-
getSupportedMethodSignatures
public java.util.Set<MethodSignature> getSupportedMethodSignatures()
从接口复制的说明:ExecutorGet a list of method signatures that indicate which methods are supported by this executor.The returned methods should be exactly the ones that the executor is expected to be able to handle. The invocation unit does not make any additional assumption on the executors available to execute a method and will match them iff the signature of the target method matches exactly.
Only full method signatures should be returned, the invocation unit does not support wildcards.
- 指定者:
getSupportedMethodSignatures在接口中Executor- 返回:
- a set of methods the executor can handle.
-
generateMethodSignaturesForModel
public static <T extends ReflectiveModel<T>> java.util.Set<MethodSignature> generateMethodSignaturesForModel(ReflectiveModelExecutor.SupportedModelInfo<T> modelInfo, HierarchyProvider hierarchy)
Computes the methods the executor needs to support for the specified classes. This consists in all the methods implemented by the specifiedReflectiveModeland additionally a signature for each class extending the class if inheritance has to be supported.- 类型参数:
T- the model modeling the clazz.- 参数:
modelInfo- information on which classes the executor wants to support (e.g., only the class modeled by a model or also everything implementing it, etc.)hierarchy- the class hierarchy.- 返回:
- the signatures the executor supports for the clazz.
-
-