com.puppycrawl.tools.checkstyle.checks.coding
Class MultipleStringLiteralsCheck
- Configurable, Contextualizable
public class MultipleStringLiteralsCheck
Checks for multiple occurrences of the same string literal within a
single file.
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken |
getId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setId, setSeverity |
MultipleStringLiteralsCheck
public MultipleStringLiteralsCheck()
Construct an instance with default values.
setAllowedDuplicates
public void setAllowedDuplicates(int aAllowedDuplicates)
Sets the maximum allowed duplicates of a string.
aAllowedDuplicates - The maximum number of duplicates.
setIgnoreOccurrenceContext
public final void setIgnoreOccurrenceContext(String[] aStrRep)
Adds a set of tokens the check is interested in.
aStrRep - the string representation of the tokens interested in
setIgnoreStringsRegexp
public void setIgnoreStringsRegexp(String aIgnoreStringsRegexp)
Sets regexp pattern for ignored strings.
aIgnoreStringsRegexp - regexp pattern for ignored strings