Class MultilineDetector
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector
A detector that matches across multiple lines.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intTracks the number of matches.private final StringThe message key for empty format.private final StringThe message key for exceeded matches.private MatcherThe matcher.private final StringThe message key for minimum matches not met.private final DetectorOptionsThe detection options to use.private final StringThe message key for StackOverflow error.private FileTextThe file text content. -
Constructor Summary
ConstructorsConstructorDescriptionMultilineDetector(DetectorOptions options, String exceededMessage, String minimumMessage, String emptyMessage, String stackOverflowMessage) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidMethod that finds the matches.private voidfinish()Perform processing at the end of a set of lines.voidprocessLines(FileText fileText) Processes an entire text file looking for matches.private voidReset the state of the detector.
-
Field Details
-
options
The detection options to use. -
exceededMessage
The message key for exceeded matches. -
minimumMessage
The message key for minimum matches not met. -
emptyMessage
The message key for empty format. -
stackOverflowMessage
The message key for StackOverflow error. -
currentMatches
Tracks the number of matches. -
matcher
The matcher. -
text
The file text content.
-
-
Constructor Details
-
MultilineDetector
MultilineDetector(DetectorOptions options, String exceededMessage, String minimumMessage, String emptyMessage, String stackOverflowMessage) Creates an instance.- Parameters:
options- the options to use.exceededMessage- the message key for exceeded matches.minimumMessage- the message key for minimum matches not met.emptyMessage- the message key for empty format.stackOverflowMessage- the message key for StackOverflow error.
-
-
Method Details
-
processLines
Processes an entire text file looking for matches.- Parameters:
fileText- the text to process
-
findMatch
Method that finds the matches. -
finish
Perform processing at the end of a set of lines. -
resetState
Reset the state of the detector.
-