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:
AutomaticBean.OutputStreamOptions
MSG_INVALID_PATTERN
Modifier | Constructor and Description |
---|---|
protected |
AbstractAccessControlNameCheck(String format)
Creates a new
AbstractAccessControlNameCheck instance. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
mustCheckName(DetailAST ast)
Decides whether the name of an AST should be checked against
the format regexp.
|
void |
setApplyToPackage(boolean applyTo)
Sets whether we should apply the check to package-private members.
|
void |
setApplyToPrivate(boolean applyTo)
Sets whether we should apply the check to private members.
|
void |
setApplyToProtected(boolean applyTo)
Sets whether we should apply the check to protected members.
|
void |
setApplyToPublic(boolean applyTo)
Sets whether we should apply the check to public members.
|
protected boolean |
shouldCheckInScope(DetailAST modifiers)
Should we check member with given modifiers.
|
setFormat, visitToken
beginTree, clearMessages, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLine, getLines, getMessages, getRequiredTokens, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setClassLoader, setFileContents, setTabWidth, setTokens
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
configure, contextualize, getConfiguration, setupChild
protected AbstractAccessControlNameCheck(String format)
AbstractAccessControlNameCheck
instance.format
- format to check withprotected boolean mustCheckName(DetailAST ast)
AbstractNameCheck
mustCheckName
in class AbstractNameCheck
ast
- the AST to check.protected boolean shouldCheckInScope(DetailAST modifiers)
modifiers
- modifiers of member to check.public void setApplyToPublic(boolean applyTo)
applyTo
- new value of the property.public void setApplyToProtected(boolean applyTo)
applyTo
- new value of the property.public void setApplyToPackage(boolean applyTo)
applyTo
- new value of the property.public void setApplyToPrivate(boolean applyTo)
applyTo
- new value of the property.Copyright © 2001–2018. All rights reserved.