Package org.benf.cfr.reader.api
Class CfrDriver.Builder
java.lang.Object
org.benf.cfr.reader.api.CfrDriver.Builder
- Enclosing interface:
- CfrDriver
Builder for
CfrDriver
Note that *all* parameters are optional. If you build a naked builder, you will get default
CFR behaviour.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Options
(package private) boolean
(package private) OutputSinkFactory
(package private) ClassFileSource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Given provided artifacts, build an instance ofCfrDriver
.withBuiltOptions
(Options options) Note - theOptions
interface is *not* guaranteed to be stable.withClassFileSource
(ClassFileSource source) Overrides where CFR searches for bytecode.withOptions
(Map<String, String> options) A map, equivalent to the command line options that are passed to CFR.withOutputSink
(OutputSinkFactory output) Handle how results / output are provided.Allows overrides of where CFR searches for bytecode, but will fall back to default behaviour if null is returned.
-
Field Details
-
source
ClassFileSource source -
builtOptions
Options builtOptions -
output
OutputSinkFactory output -
fallbackToDefaultSource
boolean fallbackToDefaultSource
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withClassFileSource
Overrides where CFR searches for bytecode. SeeClassFileSource
.- Parameters:
source
- class file source.- Returns:
- this builder.
-
withOverrideClassFileSource
Allows overrides of where CFR searches for bytecode, but will fall back to default behaviour if null is returned. SeeClassFileSource
.- Parameters:
source
- class file source.- Returns:
- this builder.
-
withOutputSink
Handle how results / output are provided.- Parameters:
output
- seeOutputSinkFactory
- Returns:
- this builder.
-
withOptions
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
Note - theOptions
interface is *not* guaranteed to be stable.- Parameters:
options
- previously built options.- Returns:
- this builder.
-
build
Given provided artifacts, build an instance ofCfrDriver
. Note that if artifacts are not provided, you will get default CFR behaviour.- Returns:
- Constructed instance of
CfrDriver
-