public class TypeNameCheck extends AbstractAccessControlNameCheck
Checks that type 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="TypeName"/>
An example of how to configure the check for names that begin with a lower case letter, followed by letters, digits, and underscores is:
<module name="TypeName"> <property name="format" value="^[a-z](_?[a-zA-Z0-9]+)*$"/> </module>
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PATTERN
Default pattern for type name.
|
MSG_INVALID_PATTERN
Constructor and Description |
---|
TypeNameCheck()
Creates a new
TypeNameCheck instance. |
Modifier and Type | Method and Description |
---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
mustCheckName, setApplyToPackage, setApplyToPrivate, setApplyToProtected, setApplyToPublic, shouldCheckInScope
setFormat, visitToken
beginTree, destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public static final String DEFAULT_PATTERN
public TypeNameCheck()
TypeNameCheck
instance.public int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
TokenTypes
public int[] getAcceptableTokens()
Check
getAcceptableTokens
in class Check
TokenTypes
public int[] getRequiredTokens()
Check
getRequiredTokens
in class Check
TokenTypes
Copyright © 2001–2016. All rights reserved.