Class DetectorOptions
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.regexp.DetectorOptions
Options for a detector.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classClass which implements Builder pattern to build DetectorOptions instance. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intFlags to compile a regular expression with.private StringFormat of the regular expression to check for.private booleanWhether to ignore case when matching.private intMaximum number of times regular expression should occur in a file.private StringThe message to report on detection.private intMinimum number of times regular expression should occur in a file.private PatternPattern created from format.private AbstractViolationReporterUsed for reporting violations.private MatchSuppressorUsed to determine whether to suppress a detected match. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFormat of the regular expression.intThe maximum number of allowed detections.The message to report violations with.intThe minimum number of allowed detections.The pattern to use when matching.The violation reporter to use.The suppressor to use.static DetectorOptions.BuilderReturns 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.
-