Package com.tonic.analysis.verifier
Class VerifierConfig.Builder
- java.lang.Object
-
- com.tonic.analysis.verifier.VerifierConfig.Builder
-
- Enclosing class:
- VerifierConfig
public static final class VerifierConfig.Builder extends Object
Builder for aVerifierConfig; all passes default to enabled with COLLECT_ALL and 100 errors.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VerifierConfigbuild()Builds the immutable configuration.VerifierConfig.BuildercollectAll()Selects COLLECT_ALL error mode.VerifierConfig.BuildererrorMode(VerifierConfig.ErrorMode errorMode)Sets the error mode, defaulting null to COLLECT_ALL.VerifierConfig.BuilderfailFast()Selects FAIL_FAST error mode.VerifierConfig.BuildermaxErrors(int max)Caps how many errors are collected, clamped to at least 1.VerifierConfig.BuilderstrictTypeChecking(boolean strict)Enables or disables the type-checking pass.VerifierConfig.BuildertreatWarningsAsErrors(boolean treat)Controls whether warnings should be treated as verification errors.VerifierConfig.BuilderverifyControlFlow(boolean verify)Enables or disables the control-flow and exception-table pass.VerifierConfig.BuilderverifyStackMapTable(boolean verify)Enables or disables the StackMapTable comparison pass.VerifierConfig.BuilderverifyStructure(boolean verify)Enables or disables the structural (opcode/operand) pass.
-
-
-
Method Detail
-
errorMode
public VerifierConfig.Builder errorMode(VerifierConfig.ErrorMode errorMode)
Sets the error mode, defaulting null to COLLECT_ALL.- Parameters:
errorMode- the mode, or null- Returns:
- this builder
-
failFast
public VerifierConfig.Builder failFast()
Selects FAIL_FAST error mode.- Returns:
- this builder
-
collectAll
public VerifierConfig.Builder collectAll()
Selects COLLECT_ALL error mode.- Returns:
- this builder
-
verifyStackMapTable
public VerifierConfig.Builder verifyStackMapTable(boolean verify)
Enables or disables the StackMapTable comparison pass.- Parameters:
verify- true to run the pass- Returns:
- this builder
-
strictTypeChecking
public VerifierConfig.Builder strictTypeChecking(boolean strict)
Enables or disables the type-checking pass.- Parameters:
strict- true to run the pass- Returns:
- this builder
-
verifyControlFlow
public VerifierConfig.Builder verifyControlFlow(boolean verify)
Enables or disables the control-flow and exception-table pass.- Parameters:
verify- true to run the pass- Returns:
- this builder
-
verifyStructure
public VerifierConfig.Builder verifyStructure(boolean verify)
Enables or disables the structural (opcode/operand) pass.- Parameters:
verify- true to run the pass- Returns:
- this builder
-
maxErrors
public VerifierConfig.Builder maxErrors(int max)
Caps how many errors are collected, clamped to at least 1.- Parameters:
max- the error cap- Returns:
- this builder
-
treatWarningsAsErrors
public VerifierConfig.Builder treatWarningsAsErrors(boolean treat)
Controls whether warnings should be treated as verification errors.- Parameters:
treat- true to escalate warnings- Returns:
- this builder
-
build
public VerifierConfig build()
Builds the immutable configuration.- Returns:
- the configuration
-
-