|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.puppycrawl.tools.checkstyle.api.AutomaticBean com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter com.puppycrawl.tools.checkstyle.api.Check com.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck
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 Summary | |
MemberNameCheck()
Creates a new MemberNameCheck instance. |
Method Summary | |
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. |
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck |
visitToken |
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck |
getFormat, getRegexp, setFormat |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check |
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter |
getMessageBundle, getSeverity, getSeverityLevel, 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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MemberNameCheck()
MemberNameCheck
instance.
Method Detail |
public int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
Check
protected final boolean mustCheckName(DetailAST aAST)
AbstractNameCheck
mustCheckName
in class AbstractNameCheck
aAST
- the AST to check.
AbstractNameCheck
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()
|
Back to the Checkstyle Home Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |