Class RegexpMultilineCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck
-
- com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
,FileSetCheck
public class RegexpMultilineCheck extends AbstractFileSetCheck
Implementation of a check that looks that matches across multiple lines in any file type.
-
-
Field Summary
Fields Modifier and Type Field Description private MultilineDetector
detector
The detector to use.private java.lang.String
format
The format of the regular expression to match.private boolean
ignoreCase
Whether to ignore case when matching.private int
maximum
The maximum number of matches required per file.private java.lang.String
message
The message to report for a match.private int
minimum
The minimum number of matches required per file.
-
Constructor Summary
Constructors Constructor Description RegexpMultilineCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginProcessing(java.lang.String charset)
Called when about to be called to process a set of files.protected void
processFiltered(java.io.File file, java.util.List<java.lang.String> lines)
Called to process a file that matches the specified file extensions.void
setFormat(java.lang.String format)
Sets the format of the regular expression to match.void
setIgnoreCase(boolean ignoreCase)
Sets whether to ignore case when matching.void
setMaximum(int maximum)
Sets the maximum number of matches required per file.void
setMessage(java.lang.String message)
Sets the message to report for a match.void
setMinimum(int minimum)
Sets the minimum number of matches required per file.-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck
destroy, finishProcessing, fireErrors, getFileExtensions, getMessageCollector, getMessageDispatcher, init, log, log, process, setFileExtensions, setMessageDispatcher
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.puppycrawl.tools.checkstyle.api.Configurable
configure
-
Methods inherited from interface com.puppycrawl.tools.checkstyle.api.Contextualizable
contextualize
-
-
-
-
Field Detail
-
format
private java.lang.String format
The format of the regular expression to match.
-
message
private java.lang.String message
The message to report for a match.
-
minimum
private int minimum
The minimum number of matches required per file.
-
maximum
private int maximum
The maximum number of matches required per file.
-
ignoreCase
private boolean ignoreCase
Whether to ignore case when matching.
-
detector
private MultilineDetector detector
The detector to use.
-
-
Method Detail
-
beginProcessing
public void beginProcessing(java.lang.String charset)
Description copied from interface:FileSetCheck
Called when about to be called to process a set of files.- Specified by:
beginProcessing
in interfaceFileSetCheck
- Overrides:
beginProcessing
in classAbstractFileSetCheck
- Parameters:
charset
- the character set used to read the files.
-
processFiltered
protected void processFiltered(java.io.File file, java.util.List<java.lang.String> lines)
Description copied from class:AbstractFileSetCheck
Called to process a file that matches the specified file extensions.- Specified by:
processFiltered
in classAbstractFileSetCheck
- Parameters:
file
- the file to be processedlines
- an immutable list of the contents of the file.
-
setFormat
public void setFormat(java.lang.String format)
Sets the format of the regular expression to match.- Parameters:
format
- the format of the regular expression to match.
-
setMessage
public void setMessage(java.lang.String message)
Sets the message to report for a match.- Parameters:
message
- the message to report for a match.
-
setMinimum
public void setMinimum(int minimum)
Sets the minimum number of matches required per file.- Parameters:
minimum
- the minimum number of matches required per file.
-
setMaximum
public void setMaximum(int maximum)
Sets the maximum number of matches required per file.- Parameters:
maximum
- the maximum number of matches required per file.
-
setIgnoreCase
public void setIgnoreCase(boolean ignoreCase)
Sets whether to ignore case when matching.- Parameters:
ignoreCase
- whether to ignore case when matching.
-
-