| net.sourceforge.pmd.AbstractRule net.sourceforge.pmd.rules.AbstractPoorMethodCall
All known Subclasses: net.sourceforge.pmd.rules.strings.UseIndexOfChar,
AbstractPoorMethodCall | abstract public class AbstractPoorMethodCall extends AbstractRule (Code) | | Detects and flags the occurrences of specific method calls against an instance of
a designated class. I.e. String.indexOf. The goal is to be able to suggest more
efficient/modern ways of implementing the same function.
Concrete subclasses are expected to provide the name of the target class and an
array of method names that we are looking for. We then pass judgement on any literal
arguments we find in the subclass as well.
author: Brian Remedios version: $Revision: 5017 $ |
isSingleCharAsString | public static boolean isSingleCharAsString(String value)(Code) | | Returns whether the value argument is a single character string.
Parameters: value - String boolean |
isViolationArgument | abstract protected boolean isViolationArgument(int argIndex, String arg)(Code) | | Returns whether the string argument at the stated position being sent to
the method is ok or not. Return true if you want to record the method call
as a violation, false otherwise.
Parameters: argIndex - int Parameters: arg - String boolean |
methodNames | abstract protected String[] methodNames()(Code) | | Return the names of all the methods we are scanning for, no brackets or
argument types.
String[] |
targetTypename | abstract protected String targetTypename()(Code) | | The name of the type the method will be invoked against.
String |
|
|