com.puppycrawl.tools.checkstyle.checks.coding

Class MultipleStringLiteralsCheck

Implemented Interfaces:
Configurable, Contextualizable

public class MultipleStringLiteralsCheck
extends Check

Checks for multiple occurrences of the same string literal within a single file.

Author:
Daniel Grenner

Method Summary

void
beginTree(DetailAST aRootAST)
void
finishTree(DetailAST aRootAST)
int[]
getDefaultTokens()
void
setAllowedDuplicates(int aAllowedDuplicates)
Sets the maximum allowed duplicates of a string.
void
visitToken(DetailAST aAST)

Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check

beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setSeverity

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

configure, contextualize, finishLocalSetup, getConfiguration, setupChild

Method Details

beginTree

public void beginTree(DetailAST aRootAST)
Overrides:
beginTree in interface Check


finishTree

public void finishTree(DetailAST aRootAST)
Overrides:
finishTree in interface Check


getDefaultTokens

public int[] getDefaultTokens()
Overrides:
getDefaultTokens in interface Check


setAllowedDuplicates

public void setAllowedDuplicates(int aAllowedDuplicates)
Sets the maximum allowed duplicates of a string.

Parameters:
aAllowedDuplicates - The maximum number of duplicates.


visitToken

public void visitToken(DetailAST aAST)
Overrides:
visitToken in interface Check