Class CallGraphConfigBuilder

java.lang.Object
sootup.callgraph.config.CallGraphConfigBuilder

public final class CallGraphConfigBuilder extends Object
Stage 1 of the unified CallGraphConfig builder chain: collects the properties shared across every call-graph algorithm family, then transitions to a family-specific stage. Obtained via CallGraphConfig.builder().

view and entryPoints are required (validated once a family stage is entered, since view is needed to construct the default CallResolver and family-specific builders validate their own required fields at build() time). Every other property defaults to the same values AbstractCallGraphAlgorithm's single-View constructor uses, so a caller who sets nothing beyond view/entryPoints gets today's default behavior for whichever family they pick.

  • Constructor Details

    • CallGraphConfigBuilder

      public CallGraphConfigBuilder()
  • Method Details

    • view

      public @NonNull CallGraphConfigBuilder view(@NonNull View view)
    • entryPoints

      public @NonNull CallGraphConfigBuilder entryPoints(@NonNull List<MethodSignature> entryPoints)
    • callResolver

      public @NonNull CallGraphConfigBuilder callResolver(@NonNull CallResolver callResolver)
      Controls which statements' calls are resolved and expanded at all (pre-dispatch).
    • virtualCallResolver

      public @NonNull CallGraphConfigBuilder virtualCallResolver(@NonNull VirtualCallResolver virtualCallResolver)
      Controls which resolved dynamic-dispatch candidates - including discovered <clinit> calls - are admitted/expanded (post-dispatch). See SuppressClinitCallResolver/ AppOnlyClinitCallResolver for ready-made <clinit>-scoping resolvers.
    • seedEntryPointClinits

      public @NonNull CallGraphConfigBuilder seedEntryPointClinits(boolean seedEntryPointClinits)
      Whether each entry point's declaring-class <clinit> is eagerly seeded as a root before traversal starts. Leave unset to get whichever family's own natural default applies (see the field javadoc above for why there's no single common default).
    • cha

      public @NonNull ChaCallGraphConfig.Builder cha()
      Transitions to the CHA-specific stage.
    • rta

      public @NonNull RtaCallGraphConfig.Builder rta()
      Transitions to the RTA-specific stage.
    • into

      public <B> @NonNull B into(@NonNull Function<CommonCallGraphSettings,B> familyBuilderFactory)
      Transitions to a family-specific stage that sootup.callgraph cannot depend on directly (Spark, Qilin - each in its own downstream module). Pass the family's static from factory method as a reference, e.g.:
         CallGraphConfig.builder()....into(SparkCallGraphConfig::from). ... .build();
         CallGraphConfig.builder()....into(QilinCallGraphConfig::from). ... .build();