public interface Rule
Modifier and Type | Field and Description |
---|---|
static int |
LOWEST_PRIORITY |
static java.lang.String[] |
PRIORITIES |
Modifier and Type | Method and Description |
---|---|
void |
addExample(java.lang.String example)
Add a single example for this Rule.
|
void |
addProperties(java.util.Properties properties)
Add a set of properties to this Rule.
|
void |
addProperty(java.lang.String name,
java.lang.String property)
Add a specific property to this Rule.
|
void |
addRuleChainVisit(java.lang.String astNodeName)
Adds an AST node name to be visited by the Rule on the RuleChain.
|
void |
apply(java.util.List<?> astCompilationUnits,
RuleContext ctx)
Apply this rule to the given collection of compilation units, using the
given context.
|
void |
end(RuleContext ctx)
End processing.
|
boolean |
getBooleanProperty(java.lang.String name)
Get the
boolean value for the given property. |
java.lang.String |
getDescription()
Get the description of this Rule.
|
double |
getDoubleProperty(java.lang.String name)
Get the
double value for the given property. |
java.lang.String |
getExample()
Deprecated.
use getExamples(), since we now support multiple examples
|
java.util.List<java.lang.String> |
getExamples()
Get the list of examples for this Rule.
|
java.lang.String |
getExternalInfoUrl()
Get a URL for external information about this Rule.
|
int |
getIntProperty(java.lang.String name)
Get the
int value for the given property. |
java.lang.String |
getMessage()
Get the message to show when this Rule identifies a violation.
|
java.lang.String |
getName()
Get the name of this Rule.
|
int |
getPriority()
Get the priority of this Rule.
|
java.lang.String |
getPriorityName()
Get a name for the priority of this Rule.
|
java.util.Properties |
getProperties()
Get all properties for this Rule.
|
java.util.List<java.lang.String> |
getRuleChainVisits()
Gets the collection of AST node names visited by the Rule on the
RuleChain.
|
java.lang.String |
getRuleClass()
Get the class of this Rule.
|
java.lang.String |
getRuleSetName()
Get the name of the RuleSet containing this Rule.
|
java.lang.String |
getSince()
Get the version of PMD in which this Rule was added.
|
java.lang.String |
getStringProperty(java.lang.String name)
Get the
java.util.String value for the given property. |
boolean |
hasProperty(java.lang.String name)
Get whether this Rule has a property of the given name.
|
boolean |
include()
Deprecated.
Don't know what this is for, so deprecating it.
|
PropertyDescriptor |
propertyDescriptorFor(java.lang.String name)
Get the PropertyDescriptor for the given property.
|
void |
setDescription(java.lang.String description)
Set the description of this Rule.
|
void |
setExternalInfoUrl(java.lang.String externalInfoUrl)
Set a URL for external information about this Rule.
|
void |
setInclude(boolean include)
Deprecated.
Don't know what this is for, so deprecating it.
|
void |
setMessage(java.lang.String message)
Set the message to show when this Rule identifies a violation.
|
void |
setName(java.lang.String name)
Set the name of this Rule.
|
void |
setPriority(int priority)
Set the priority of this Rule.
|
void |
setRuleClass(java.lang.String ruleClass)
Set the class of this Rule.
|
void |
setRuleSetName(java.lang.String name)
Set the name of the RuleSet containing this Rule.
|
void |
setSince(java.lang.String since)
Set the version of PMD in which this Rule was added.
|
void |
setUsesDFA()
Sets whether this Rule uses Data Flow Analysis.
|
void |
setUsesTypeResolution()
Sets whether this Rule uses Type Resolution.
|
void |
start(RuleContext ctx)
Start processing.
|
boolean |
usesDFA()
Gets whether this Rule uses Data Flow Analysis.
|
boolean |
usesRuleChain()
Gets whether this Rule uses the RuleChain.
|
boolean |
usesTypeResolution()
Gets whether this Rule uses Type Resolution.
|
static final int LOWEST_PRIORITY
static final java.lang.String[] PRIORITIES
java.lang.String getName()
void setName(java.lang.String name)
java.lang.String getSince()
null
if not applicable.void setSince(java.lang.String since)
java.lang.String getRuleClass()
void setRuleClass(java.lang.String ruleClass)
java.lang.String getRuleSetName()
RuleSet
void setRuleSetName(java.lang.String name)
RuleSet
java.lang.String getMessage()
void setMessage(java.lang.String message)
java.lang.String getDescription()
void setDescription(java.lang.String description)
java.util.List<java.lang.String> getExamples()
java.lang.String getExample()
void addExample(java.lang.String example)
java.lang.String getExternalInfoUrl()
void setExternalInfoUrl(java.lang.String externalInfoUrl)
int getPriority()
void setPriority(int priority)
java.lang.String getPriorityName()
boolean include()
void setInclude(boolean include)
java.util.Properties getProperties()
void addProperty(java.lang.String name, java.lang.String property)
void addProperties(java.util.Properties properties)
boolean hasProperty(java.lang.String name)
boolean getBooleanProperty(java.lang.String name)
boolean
value for the given property.int getIntProperty(java.lang.String name)
int
value for the given property.double getDoubleProperty(java.lang.String name)
double
value for the given property.java.lang.String getStringProperty(java.lang.String name)
java.util.String
value for the given property.PropertyDescriptor propertyDescriptorFor(java.lang.String name)
void setUsesDFA()
boolean usesDFA()
void setUsesTypeResolution()
boolean usesTypeResolution()
boolean usesRuleChain()
java.util.List<java.lang.String> getRuleChainVisits()
void addRuleChainVisit(java.lang.String astNodeName)
void start(RuleContext ctx)
void apply(java.util.List<?> astCompilationUnits, RuleContext ctx)
void end(RuleContext ctx)