public class UniquePropertiesCheck extends AbstractFileSetCheck
Modifier and Type | Class and Description |
---|---|
private static class |
UniquePropertiesCheck.UniqueProperties
Properties subclass to store duplicated property keys in a separate map.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MSG_IO_EXCEPTION_KEY
Localization key for IO exception occurred on file open.
|
static java.lang.String |
MSG_KEY
Localization key for check violation.
|
private static java.util.regex.Pattern |
SPACE_PATTERN
Pattern matching single space.
|
Constructor and Description |
---|
UniquePropertiesCheck()
Construct the check with default values.
|
Modifier and Type | Method and Description |
---|---|
protected static int |
getLineNumber(java.util.List<java.lang.String> lines,
java.lang.String keyName)
Method returns line number the key is detected in the checked properties
files first.
|
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.
|
beginProcessing, destroy, finishProcessing, fireErrors, getFileExtensions, getMessageCollector, getMessageDispatcher, init, log, log, process, setFileExtensions, setMessageDispatcher
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure
contextualize
public static final java.lang.String MSG_KEY
public static final java.lang.String MSG_IO_EXCEPTION_KEY
private static final java.util.regex.Pattern SPACE_PATTERN
public UniquePropertiesCheck()
protected void processFiltered(java.io.File file, java.util.List<java.lang.String> lines)
AbstractFileSetCheck
processFiltered
in class AbstractFileSetCheck
file
- the file to be processedlines
- an immutable list of the contents of the file.protected static int getLineNumber(java.util.List<java.lang.String> lines, java.lang.String keyName)
lines
- properties file lines listkeyName
- key name to look for