Class CfrDriver.Builder

java.lang.Object
org.benf.cfr.reader.api.CfrDriver.Builder
Enclosing interface:
CfrDriver

public static class CfrDriver.Builder extends Object
Builder for CfrDriver Note that *all* parameters are optional. If you build a naked builder, you will get default CFR behaviour.
  • Field Details

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withClassFileSource

      public CfrDriver.Builder withClassFileSource(ClassFileSource source)
      Overrides where CFR searches for bytecode. See ClassFileSource.
      Parameters:
      source - class file source.
      Returns:
      this builder.
    • withOverrideClassFileSource

      public CfrDriver.Builder withOverrideClassFileSource(ClassFileSource source)
      Allows overrides of where CFR searches for bytecode, but will fall back to default behaviour if null is returned. See ClassFileSource.
      Parameters:
      source - class file source.
      Returns:
      this builder.
    • withOutputSink

      public CfrDriver.Builder withOutputSink(OutputSinkFactory output)
      Handle how results / output are provided.
      Parameters:
      output - see OutputSinkFactory
      Returns:
      this builder.
    • withOptions

      public CfrDriver.Builder withOptions(Map<String,String> options)
      A map, equivalent to the command line options that are passed to CFR. Note. Strong values on this are not guaranteed, however you should expect that command line options to CFR do not change. eg { "sugarboxing" -> "false" } You may use { OptionsImpl.SUGAR_BOXING.getName() -> "false" } However, this is not guaranteed to remain in place currently, and may lead to compile / runtime errors in subsequent versions.
      Parameters:
      options - map of options
      Returns:
      this builder.
    • withBuiltOptions

      public CfrDriver.Builder withBuiltOptions(Options options)
      Note - the Options interface is *not* guaranteed to be stable.
      Parameters:
      options - previously built options.
      Returns:
      this builder.
    • build

      public CfrDriver build()
      Given provided artifacts, build an instance of CfrDriver. Note that if artifacts are not provided, you will get default CFR behaviour.
      Returns:
      Constructed instance of CfrDriver