Class DetectorOptions
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.regexp.DetectorOptions
-
public final class DetectorOptions extends Object
Options for a detector.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DetectorOptions.Builder
Class which implements Builder pattern to build DetectorOptions instance.
-
Field Summary
Fields Modifier and Type Field Description private int
compileFlags
Flags to compile a regular expression with.private String
format
Format of the regular expression to check for.private boolean
ignoreCase
Whether to ignore case when matching.private int
maximum
Maximum number of times regular expression should occur in a file.private String
message
The message to report on detection.private int
minimum
Minimum number of times regular expression should occur in a file.private Pattern
pattern
Pattern created from format.private AbstractViolationReporter
reporter
Used for reporting violations.private MatchSuppressor
suppressor
Used to determine whether to suppress a detected match.
-
Constructor Summary
Constructors Modifier Constructor Description private
DetectorOptions()
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getFormat()
Format of the regular expression.int
getMaximum()
The maximum number of allowed detections.String
getMessage()
The message to report violations with.int
getMinimum()
The minimum number of allowed detections.Pattern
getPattern()
The pattern to use when matching.AbstractViolationReporter
getReporter()
The violation reporter to use.MatchSuppressor
getSuppressor()
The suppressor to use.static DetectorOptions.Builder
newBuilder()
Returns new Builder object.
-
-
-
Field Detail
-
compileFlags
private int compileFlags
Flags to compile a regular expression with. SeePattern.flags()
.
-
reporter
private AbstractViolationReporter reporter
Used for reporting violations.
-
minimum
private int minimum
Minimum number of times regular expression should occur in a file.
-
maximum
private int maximum
Maximum number of times regular expression should occur in a file.
-
ignoreCase
private boolean ignoreCase
Whether to ignore case when matching.
-
suppressor
private MatchSuppressor suppressor
Used to determine whether to suppress a detected match.
-
-
Constructor Detail
-
DetectorOptions
private DetectorOptions()
Default constructor.
-
-
Method Detail
-
newBuilder
public static DetectorOptions.Builder newBuilder()
Returns new Builder object.- Returns:
- Builder object.
-
getFormat
public String getFormat()
Format of the regular expression.- Returns:
- format of the regular expression.
-
getReporter
public AbstractViolationReporter getReporter()
The violation reporter to use.- Returns:
- the violation reporter to use.
-
getMessage
public String getMessage()
The message to report violations with.- Returns:
- the message to report violations with.
-
getMinimum
public int getMinimum()
The minimum number of allowed detections.- Returns:
- the minimum number of allowed detections.
-
getMaximum
public int getMaximum()
The maximum number of allowed detections.- Returns:
- the maximum number of allowed detections.
-
getSuppressor
public MatchSuppressor getSuppressor()
The suppressor to use.- Returns:
- the suppressor to use.
-
getPattern
public Pattern getPattern()
The pattern to use when matching.- Returns:
- the pattern to use when matching.
-
-