public class MemberNameCheck extends AbstractNameCheck
Checks that instance variable names conform to a format specified
by the format property. The format is a
regular expression
and defaults to
^[a-z][a-zA-Z0-9]*$.
An example of how to configure the check is:
<module name="MemberName"/>
An example of how to configure the check for names that begin with "m", followed by an upper case letter, and then letters and digits is:
<module name="MemberName">
<property name="format" value="^m[A-Z][a-zA-Z0-9]*$"/>
</module>
| Constructor and Description |
|---|
MemberNameCheck()
Creates a new
MemberNameCheck instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getApplyToPackage() |
boolean |
getApplyToPrivate() |
boolean |
getApplyToProtected() |
boolean |
getApplyToPublic() |
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
protected boolean |
mustCheckName(DetailAST aAST)
Decides whether the name of an AST should be checked against
the format regexp.
|
void |
setApplyToPackage(boolean aApplyTo)
Sets whether we should apply the check to package-private members.
|
void |
setApplyToPrivate(boolean aApplyTo)
Sets whether we should apply the check to private members.
|
void |
setApplyToProtected(boolean aApplyTo)
Sets whether we should apply the check to protected members.
|
void |
setApplyToPublic(boolean aApplyTo)
Sets whether we should apply the check to public members.
|
visitTokengetFormat, getRegexp, setCompileFlags, setFormatbeginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic int[] getDefaultTokens()
getDefaultTokens in class CheckTokenTypesprotected final boolean mustCheckName(DetailAST aAST)
mustCheckName in class AbstractNameCheckaAST - the AST to check.public void setApplyToPublic(boolean aApplyTo)
aApplyTo - new value of the property.public boolean getApplyToPublic()
public void setApplyToProtected(boolean aApplyTo)
aApplyTo - new value of the property.public boolean getApplyToProtected()
public void setApplyToPackage(boolean aApplyTo)
aApplyTo - new value of the property.public boolean getApplyToPackage()
public void setApplyToPrivate(boolean aApplyTo)
aApplyTo - new value of the property.public boolean getApplyToPrivate()