|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.AbstractAccessControlNameCheck
public abstract class AbstractAccessControlNameCheck
Abstract class for checking a class member (field/method)'s name conforms to a format specified by the format property.
This class extends AbstractNameCheck
with support for access level
restrictions. This allows the check to be configured to be applied to one of
the four Java access levels: public
, protected
,
"package"
, and private
.
Level is configured using the following properties:
Constructor Summary | |
---|---|
AbstractAccessControlNameCheck(String aFormat)
Creates a new AbstractAccessControlNameCheck instance. |
Method Summary | |
---|---|
boolean |
getApplyToPackage()
|
boolean |
getApplyToPrivate()
|
boolean |
getApplyToProtected()
|
boolean |
getApplyToPublic()
|
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. |
protected boolean |
shouldCheckInScope(DetailAST aModifiers)
Should we check member with given modifiers. |
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck |
---|
visitToken |
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractFormatCheck |
---|
getFormat, getRegexp, setCompileFlags, setFormat |
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 |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter |
---|
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, 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 AbstractAccessControlNameCheck(String aFormat)
AbstractAccessControlNameCheck
instance.
aFormat
- format to check withMethod Detail |
---|
protected boolean mustCheckName(DetailAST aAST)
AbstractNameCheck
mustCheckName
in class AbstractNameCheck
aAST
- the AST to check.
protected boolean shouldCheckInScope(DetailAST aModifiers)
aModifiers
- modifiers of member 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()
|
Back to the Checkstyle Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |