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[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
getApplyToPackage, getApplyToPrivate, getApplyToProtected, getApplyToPublic, mustCheckName, setApplyToPackage, setApplyToPrivate, setApplyToProtected, setApplyToPublic, shouldCheckInScope
visitToken
getFormat, getRegexp, setCompileFlags, setFormat
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLine, getLines, getRequiredTokens, 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()
getDefaultTokens
in class Check
TokenTypes
Copyright © 2001–2015. All rights reserved.