Checks that a local variable or a parameter does not shadow
a field that is defined in the same class.
An example of how to configure the check is:
<module name="HiddenField"/>
An example of how to configure the check so that it checks variables but not
parameters is:
<module name="HiddenField">
<property name="tokens" value="VARIABLE_DEF"/>
</module>
An example of how to configure the check so that it ignores the parameter of
a setter method is:
<module name="HiddenField">
<property name="ignoreSetter" value="true"/>
</module>
An example of how to configure the check so that it ignores constructor
parameters is:
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
</module>
getAcceptableTokens
public int[] getAcceptableTokens()
- getAcceptableTokens in interface Check
Check
getDefaultTokens
public int[] getDefaultTokens()
- getDefaultTokens in interface Check
Check
getRegexp
public RE getRegexp()
- the regexp to match against
getRequiredTokens
public int[] getRequiredTokens()
- getRequiredTokens in interface Check
Check
setIgnoreConstructorParameter
public void setIgnoreConstructorParameter(boolean aIgnoreConstructorParameter)
Set whether to ignore constructor parameters.
aIgnoreConstructorParameter
- decide whether to ignore
constructor parameters.
setIgnoreFormat
public void setIgnoreFormat(String aFormat)
throws ConversionException
Set the ignore format to the specified regular expression.
aFormat
- a String
value
setIgnoreSetter
public void setIgnoreSetter(boolean aIgnoreSetter)
Set whether to ignore the parameter of a property setter method.
aIgnoreSetter
- decide whether to ignore the parameter of
a property setter method.