public class RegexpHeaderCheck extends AbstractHeaderCheck
regular expression
for each line of the source header. In default configuration,
if header is not specified, the default value of header is set to null
and the check does not rise any violations.AutomaticBean.OutputStreamOptions
Modifier and Type | Field and Description |
---|---|
static String |
MSG_HEADER_MISMATCH
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
MSG_HEADER_MISSING
A key is pointing to the warning message text in "messages.properties"
file.
|
Constructor and Description |
---|
RegexpHeaderCheck() |
Modifier and Type | Method and Description |
---|---|
protected void |
postProcessHeaderLines()
Hook method for post processing header lines.
|
protected void |
processFiltered(File file,
FileText fileText)
Called to process a file that matches the specified file extensions.
|
void |
setHeader(String header)
Validates the
header by compiling it with
Pattern.compile(String) and throws
IllegalArgumentException if header isn't a valid pattern. |
void |
setMultiLines(int... list)
Set the lines numbers to repeat in the header check.
|
finishLocalSetup, getExternalResourceLocations, getHeaderLines, setCharset, setHeaderFile
addMessages, beginProcessing, destroy, finishProcessing, fireErrors, getFileExtensions, getMessageDispatcher, init, log, log, process, setFileExtensions, setMessageDispatcher
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
configure, contextualize, getConfiguration, setupChild
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure
contextualize
public static final String MSG_HEADER_MISSING
public static final String MSG_HEADER_MISMATCH
public RegexpHeaderCheck()
public void setMultiLines(int... list)
list
- comma separated list of line numbers to repeat in header.protected void processFiltered(File file, FileText fileText)
AbstractFileSetCheck
processFiltered
in class AbstractFileSetCheck
file
- the file to be processedfileText
- the contents of the file.protected void postProcessHeaderLines()
AbstractHeaderCheck
postProcessHeaderLines
in class AbstractHeaderCheck
public void setHeader(String header)
header
by compiling it with
Pattern.compile(String)
and throws
IllegalArgumentException
if header
isn't a valid pattern.setHeader
in class AbstractHeaderCheck
header
- the header value to validate and set (in that order)Copyright © 2001–2018. All rights reserved.