com.puppycrawl.tools.checkstyle.checks.naming
public class MemberNameCheck extends AbstractNameCheck
Checks that instance variable names conform to a format specified
by the format property. The format is a
java.util.regex.Pattern regular expression
and defaults to
^[a-z][a-zA-Z0-9]*$.
An example of how to configure the check is:
<module name="MemberName"/>
An example of how to configure the check for names that begin with "m", followed by an upper case letter, and then letters and digits is:
<module name="MemberName">
<property name="format" value="^m[A-Z][a-zA-Z0-9]*$"/>
</module>
Version: 1.0
| Constructor Summary | |
|---|---|
| MemberNameCheck() Creates a new MemberNameCheck instance. | |
| Method Summary | |
|---|---|
| boolean | getApplyToPackage() |
| boolean | getApplyToPrivate() |
| boolean | getApplyToProtected() |
| boolean | getApplyToPublic() |
| int[] | getDefaultTokens() |
| protected boolean | mustCheckName(DetailAST aAST) |
| 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. |
MemberNameCheck instance.Returns: true if the check should be applied to package-private members.
Returns: true if the check should be applied to private members.
Returns: true if the check should be applied to protected members.
Returns: true if the check should be applied to public members.
Parameters: aApplyTo new value of the property.
Parameters: aApplyTo new value of the property.
Parameters: aApplyTo new value of the property.
Parameters: aApplyTo new value of the property.