Class SimpleAccessorNameNotationCheck
- java.lang.Object
- 
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
- 
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
- 
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
- 
- com.github.sevntu.checkstyle.checks.coding.SimpleAccessorNameNotationCheck
 
 
 
 
- 
- All Implemented Interfaces:
- com.puppycrawl.tools.checkstyle.api.Configurable,- com.puppycrawl.tools.checkstyle.api.Contextualizable
 
 public class SimpleAccessorNameNotationCheck extends com.puppycrawl.tools.checkstyle.api.AbstractCheckThis check verify incorrect name of setter and getter methods if it used field with other name. For example, method has name 'setXXX', but define field with name 'YYY'. Setter and getter methods must have next view: XXXType getXXXName() {return XXXName} XXXType getXXXName() {return this.XXXName} void setXXXName(XXXType value) { this.XXXName = value} void setXXXName(XXXType value) { XXXName = value} If name of field contains prefix,then must to be define parameter 'prefix' , for example: <module name="SimpleAccessorNameNotationCheck"> < property name="prefix" value="m_"/> </module> - Since:
- 1.9.0
- Author:
- Hidoyatov Victor, Ilja Dubinin
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringMSG_KEY_GETTERA key is pointing to the warning message text in "messages.properties" file.static StringMSG_KEY_SETTERA key is pointing to the warning message text in "messages.properties" file.
 - 
Constructor SummaryConstructors Constructor Description SimpleAccessorNameNotationCheck()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]getAcceptableTokens()int[]getDefaultTokens()int[]getRequiredTokens()voidsetPrefix(String prefix)Setter for prefix.voidvisitToken(com.puppycrawl.tools.checkstyle.api.DetailAST methodDef)- 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheckbeginTree, clearViolations, destroy, finishTree, getFileContents, getFilePath, getLine, getLineCodePoints, getLines, getTabWidth, getTokenNames, getViolations, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens
 - 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporterfinishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
 
- 
 
- 
- 
- 
Field Detail- 
MSG_KEY_GETTERpublic static final String MSG_KEY_GETTER A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
 
 - 
MSG_KEY_SETTERpublic static final String MSG_KEY_SETTER A key is pointing to the warning message text in "messages.properties" file.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
setPrefixpublic void setPrefix(String prefix) Setter for prefix.- Parameters:
- prefix- - prefix of field's name
 
 - 
getDefaultTokenspublic int[] getDefaultTokens() - Specified by:
- getDefaultTokensin class- com.puppycrawl.tools.checkstyle.api.AbstractCheck
 
 - 
getAcceptableTokenspublic int[] getAcceptableTokens() - Specified by:
- getAcceptableTokensin class- com.puppycrawl.tools.checkstyle.api.AbstractCheck
 
 - 
getRequiredTokenspublic int[] getRequiredTokens() - Specified by:
- getRequiredTokensin class- com.puppycrawl.tools.checkstyle.api.AbstractCheck
 
 - 
visitTokenpublic void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST methodDef) - Overrides:
- visitTokenin class- com.puppycrawl.tools.checkstyle.api.AbstractCheck
 
 
- 
 
-