Package sootup.callgraph.reflection
Interface ReflectionModel
- All Known Implementing Classes:
AbstractReflectionModel,TamiflexReflectionModel
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Makes reflective calls (
Method.invoke, Class.newInstance, ...) explicit: returns
a body in which each resolved reflective call is preceded by plain Jimple stmts (allocations,
direct invokes, field accesses) modeling its effect. Consulted once per method whose body a call
graph algorithm inspects - pluggable like CallResolver.
Implementations must be deterministic per method: CHA, RTA, Spark and Qilin may ask for the
same method repeatedly (and Spark reuses a CHA graph built from the same model), so repeated
calls should return the same Body instance - see AbstractReflectionModel.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanisNone()Whether this model isnone().static @NonNull ReflectionModelnone()Model that resolves nothing - the default everywhere.@NonNull Bodyresolve(@NonNull SootMethod method, @NonNull Body body)
-
Method Details
-
resolve
- Parameters:
method- the method owningbodybody- the body to rewrite (not modified)- Returns:
bodyitself if nothing reflective was resolved, else a rewritten copy
-
none
Model that resolves nothing - the default everywhere. -
isNone
default boolean isNone()Whether this model isnone().
-