net.sourceforge.pmd
public abstract class AbstractRule extends JavaParserVisitorAdapter implements Rule
Field Summary | |
---|---|
protected String | description |
protected String | example |
protected String | externalInfoUrl |
protected boolean | include |
protected String | message |
protected String | name |
protected int | priority |
protected Properties | properties |
protected String | ruleSetName |
protected boolean | usesDFA |
Method Summary | |
---|---|
void | addProperties(Properties properties) |
void | addProperty(String name, String value) |
protected void | addViolation(Object data, SimpleNode node)
Adds a violation to the report.
|
protected void | addViolation(Object data, SimpleNode node, String embed)
Adds a violation to the report.
|
protected void | addViolation(Object data, Node node, Object[] args)
Adds a violation to the report.
|
protected void | addViolationWithMessage(Object data, SimpleNode node, String msg)
Adds a violation to the report.
|
void | apply(List acus, RuleContext ctx) |
boolean | equals(Object o)
Test if rules are equals. |
boolean | getBooleanProperty(String name) |
protected String | getDeclaringType(SimpleNode node)
Gets the Image of the first parent node of type ASTClassOrInterfaceDeclaration or null
|
String | getDescription() |
double | getDoubleProperty(String name) |
String | getExample() |
String | getExternalInfoUrl() |
int | getIntProperty(String name) |
String | getMessage() |
String | getName() |
int | getPriority() |
String | getPriorityName() |
Properties | getProperties() |
String | getRuleSetName() |
String | getStringProperty(String name) |
int | hashCode()
Return a hash code to conform to equality. |
boolean | hasProperty(String name) |
boolean | include() |
void | setDescription(String description) |
void | setExample(String example) |
void | setExternalInfoUrl(String url) |
void | setInclude(boolean include) |
void | setMessage(String message) |
void | setName(String name) |
void | setPriority(int priority) |
void | setRuleSetName(String ruleSetName) |
void | setUsesDFA() |
boolean | usesDFA() |
protected void | visitAll(List acus, RuleContext ctx) |
Parameters: ctx the RuleContext node the node that produces the violation
Parameters: ctx the RuleContext node the node that produces the violation embed a variable to embed in the rule violation message
Parameters: ctx the RuleContext node the node that produces the violation, may be null, in which case all line and column info will be set to zero args objects to embed in the rule violation message
Parameters: ctx the RuleContext node the node that produces the violation msg specific message to put in the report
null
Parameters: node the node which will be searched