public class VisibilityModifierCheck extends Check
Public members are not flagged if the name matches the public member regular expression (contains "^serialVersionUID$" by default).
Rationale: Enforce encapsulation.| Constructor and Description |
|---|
VisibilityModifierCheck()
Create an instance.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
boolean |
isPackageAllowed() |
boolean |
isProtectedAllowed() |
void |
setPackageAllowed(boolean aPackageAllowed)
Set whether package visible members are allowed.
|
void |
setProtectedAllowed(boolean aProtectedAllowed)
Set whether protected members are allowed.
|
void |
setPublicMemberPattern(String aPattern)
Set the pattern for public members to ignore.
|
void |
visitToken(DetailAST aAST)
Called to process a token.
|
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic boolean isProtectedAllowed()
public void setProtectedAllowed(boolean aProtectedAllowed)
aProtectedAllowed - whether protected members are allowedpublic boolean isPackageAllowed()
public void setPackageAllowed(boolean aPackageAllowed)
aPackageAllowed - whether package visible members are allowedpublic void setPublicMemberPattern(String aPattern)
aPattern - pattern for public members to ignore.public int[] getDefaultTokens()
CheckgetDefaultTokens in class CheckTokenTypespublic void visitToken(DetailAST aAST)
CheckvisitToken in class CheckaAST - the token to processCopyright © 2001-2012. All Rights Reserved.