| org.hammurapi.inspectors.HardcodedLiteralsRule org.hammurapi.inspectors.HardcodedNumericLiteralsRule
HardcodedNumericLiteralsRule | public class HardcodedNumericLiteralsRule extends HardcodedLiteralsRule implements Parameterizable(Code) | | ER-011
Avoid hardwired numeric literals
author: Pavel Vlasov version: $Revision: 1.2 $ |
Method Summary | |
public String | getConfigInfo() Gives back the preconfigured values. | public boolean | setParameter(String name, Object parameter) Configures rule. | public void | visit(DoubleConstant element) Reviews the double constant literals, if they are allowed. | public void | visit(FloatConstant element) Reviews the float constant literals, if they are allowed. | public void | visit(IntegerConstant element) Reviews the int constant literals, if they are allowed. | public void | visit(LongConstant element) Reviews the long constant literals, if they are allowed. |
getConfigInfo | public String getConfigInfo()(Code) | | Gives back the preconfigured values.
|
setParameter | public boolean setParameter(String name, Object parameter) throws ConfigurationException(Code) | | Configures rule. Reads in the values of the parameters containing the
allowed numeric literals. It checks them if they can be parsed as double.
Parameters: name - the name of the parameter being loaded from Hammurapi configuration Parameters: value - the value of the parameter being loaded from Hammurapi configuration exception: ConfigurationException - in case of a not supported parameter name, or value. |
visit | public void visit(DoubleConstant element)(Code) | | Reviews the double constant literals, if they are allowed.
Parameters: element - the literal to be reviewed. |
visit | public void visit(FloatConstant element)(Code) | | Reviews the float constant literals, if they are allowed.
Parameters: element - the literal to be reviewed. |
visit | public void visit(IntegerConstant element)(Code) | | Reviews the int constant literals, if they are allowed.
Parameters: element - the literal to be reviewed. |
visit | public void visit(LongConstant element)(Code) | | Reviews the long constant literals, if they are allowed.
Parameters: element - the literal to be reviewed. |
Methods inherited from org.hammurapi.inspectors.HardcodedLiteralsRule | protected void analyze(LanguageElement element)(Code)(Java Doc) public void leave(VariableDefinition vd)(Code)(Java Doc) public void visit(VariableDefinition vd)(Code)(Java Doc)
|
|
|