public abstract class AbstractAccessControlNameCheck extends AbstractNameCheck
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 and Description |
---|
AbstractAccessControlNameCheck(String aFormat)
Creates a new
AbstractAccessControlNameCheck instance. |
Modifier and Type | Method and Description |
---|---|
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.
|
visitToken
getFormat, getRegexp, setCompileFlags, setFormat
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public AbstractAccessControlNameCheck(String aFormat)
AbstractAccessControlNameCheck
instance.aFormat
- format to check withprotected 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()
Copyright © 2001–2018. All rights reserved.