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