|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.pmd.CommonAbstractRule
public abstract class CommonAbstractRule
Basic abstract implementation of all parser-independent methods of the Rule interface.
| Field Summary |
|---|
| Fields inherited from interface net.sourceforge.pmd.Rule |
|---|
LOWEST_PRIORITY, PRIORITIES |
| Constructor Summary | |
|---|---|
CommonAbstractRule()
|
|
| Method Summary | |
|---|---|
void |
addExample(java.lang.String example)
Add a single example for this Rule. |
void |
addProperties(java.util.Properties properties)
Deprecated. |
void |
addProperty(java.lang.String name,
java.lang.String value)
Deprecated. |
void |
addRuleChainVisit(java.lang.String astNodeName)
Adds an AST node name to be visited by the Rule on the RuleChain. |
protected static java.util.Map<java.lang.String,PropertyDescriptor> |
asFixedMap(PropertyDescriptor descriptor)
|
protected static java.util.Map<java.lang.String,PropertyDescriptor> |
asFixedMap(PropertyDescriptor[] descriptors)
|
void |
end(RuleContext ctx)
End processing. |
boolean |
equals(java.lang.Object o)
Rules are equal if: They have the same implementation class. They have the same name. They have the same priority. They share the same properties. |
boolean[] |
getBooleanProperties(PropertyDescriptor descriptor)
|
boolean |
getBooleanProperty(PropertyDescriptor descriptor)
|
boolean |
getBooleanProperty(java.lang.String name)
Deprecated. - use getBooleanProperty(PropertyDescriptor) instead |
java.lang.String |
getDescription()
Get the description of this Rule. |
double[] |
getDoubleProperties(PropertyDescriptor descriptor)
|
double |
getDoubleProperty(PropertyDescriptor descriptor)
|
double |
getDoubleProperty(java.lang.String name)
Deprecated. - use getDoubleProperty(PropertyDescriptor) instead |
java.lang.String |
getExample()
Still used by the JDeveloper plugin |
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[] |
getIntProperties(PropertyDescriptor descriptor)
|
int |
getIntProperty(PropertyDescriptor descriptor)
|
int |
getIntProperty(java.lang.String name)
Deprecated. - use getIntProperty(PropertyDescriptor) instead |
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()
Deprecated. - retrieve by name using get |
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[] |
getStringProperties(PropertyDescriptor descriptor)
|
java.lang.String |
getStringProperty(PropertyDescriptor descriptor)
|
java.lang.String |
getStringProperty(java.lang.String name)
Deprecated. - use getStringProperty(PropertyDescriptor) instead |
java.lang.Class[] |
getTypeProperties(PropertyDescriptor descriptor)
|
java.lang.Class |
getTypeProperty(PropertyDescriptor descriptor)
|
int |
hashCode()
|
boolean |
hasProperty(java.lang.String name)
Deprecated. - property values will be guaranteed available via default values |
boolean |
include()
TODO What is this? |
protected java.util.Map<java.lang.String,PropertyDescriptor> |
propertiesByName()
Return all the relevant properties for the receiver by overriding in subclasses as necessary. |
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)
TODO What is this? |
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 |
setProperties(PropertyDescriptor descriptor,
java.lang.Object[] values)
|
void |
setProperty(PropertyDescriptor descriptor,
java.lang.Object value)
|
void |
setRuleClass(java.lang.String ruleClass)
Set the class of this Rule. |
void |
setRuleSetName(java.lang.String ruleSetName)
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sourceforge.pmd.Rule |
|---|
apply |
| Constructor Detail |
|---|
public CommonAbstractRule()
| Method Detail |
|---|
public java.lang.String getName()
Rule
getName in interface Rulepublic void setName(java.lang.String name)
Rule
setName in interface Rulepublic java.lang.String getSince()
Rulenull if not applicable.
getSince in interface Rulepublic void setSince(java.lang.String since)
Rule
setSince in interface Rulepublic java.lang.String getRuleClass()
Rule
getRuleClass in interface Rulepublic void setRuleClass(java.lang.String ruleClass)
Rule
setRuleClass in interface Rulepublic java.lang.String getRuleSetName()
Rule
getRuleSetName in interface RuleRuleSetpublic void setRuleSetName(java.lang.String ruleSetName)
Rule
setRuleSetName in interface RuleRuleSetpublic java.lang.String getMessage()
Rule
getMessage in interface Rulepublic void setMessage(java.lang.String message)
Rule
setMessage in interface Rulepublic java.lang.String getDescription()
Rule
getDescription in interface Rulepublic void setDescription(java.lang.String description)
Rule
setDescription in interface Rulepublic java.util.List<java.lang.String> getExamples()
Rule
getExamples in interface Rulepublic java.lang.String getExample()
Rule
getExample in interface Rulepublic void addExample(java.lang.String example)
Rule
addExample in interface Rulepublic java.lang.String getExternalInfoUrl()
Rule
getExternalInfoUrl in interface Rulepublic void setExternalInfoUrl(java.lang.String externalInfoUrl)
Rule
setExternalInfoUrl in interface Rulepublic int getPriority()
Rule
getPriority in interface Rulepublic void setPriority(int priority)
Rule
setPriority in interface Rulepublic java.lang.String getPriorityName()
Rule
getPriorityName in interface Rulepublic boolean include()
Rule
include in interface Rulepublic void setInclude(boolean include)
Rule
setInclude in interface Rulepublic java.util.Properties getProperties()
Rule
getProperties in interface Rule
public void addProperty(java.lang.String name,
java.lang.String value)
Rule
addProperty in interface Rulepublic void addProperties(java.util.Properties properties)
Rule
addProperties in interface Rulepublic boolean hasProperty(java.lang.String name)
Rule
hasProperty in interface Rulepublic boolean getBooleanProperty(java.lang.String name)
Ruleboolean value for the given property.
getBooleanProperty in interface Rulepublic boolean getBooleanProperty(PropertyDescriptor descriptor)
public boolean[] getBooleanProperties(PropertyDescriptor descriptor)
public int getIntProperty(java.lang.String name)
Ruleint value for the given property.
getIntProperty in interface Rulepublic int getIntProperty(PropertyDescriptor descriptor)
public int[] getIntProperties(PropertyDescriptor descriptor)
public double getDoubleProperty(java.lang.String name)
Ruledouble value for the given property.
getDoubleProperty in interface Rulepublic double getDoubleProperty(PropertyDescriptor descriptor)
public double[] getDoubleProperties(PropertyDescriptor descriptor)
public java.lang.String getStringProperty(java.lang.String name)
Rulejava.util.String value for the given property.
getStringProperty in interface Rulepublic java.lang.String getStringProperty(PropertyDescriptor descriptor)
public java.lang.String[] getStringProperties(PropertyDescriptor descriptor)
public java.lang.Class[] getTypeProperties(PropertyDescriptor descriptor)
public java.lang.Class getTypeProperty(PropertyDescriptor descriptor)
public void setProperty(PropertyDescriptor descriptor,
java.lang.Object value)
public void setProperties(PropertyDescriptor descriptor,
java.lang.Object[] values)
protected java.util.Map<java.lang.String,PropertyDescriptor> propertiesByName()
public PropertyDescriptor propertyDescriptorFor(java.lang.String name)
Rule
propertyDescriptorFor in interface Rulepublic void setUsesDFA()
Rule
setUsesDFA in interface Rulepublic boolean usesDFA()
Rule
usesDFA in interface Rulepublic void setUsesTypeResolution()
Rule
setUsesTypeResolution in interface Rulepublic boolean usesTypeResolution()
Rule
usesTypeResolution in interface Rulepublic boolean usesRuleChain()
Rule
usesRuleChain in interface Rulepublic java.util.List<java.lang.String> getRuleChainVisits()
Rule
getRuleChainVisits in interface Rulepublic void addRuleChainVisit(java.lang.String astNodeName)
Rule
addRuleChainVisit in interface Rulepublic void start(RuleContext ctx)
Rule
start in interface Rulepublic void end(RuleContext ctx)
Rule
end in interface Rulepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectequals(Object)protected static java.util.Map<java.lang.String,PropertyDescriptor> asFixedMap(PropertyDescriptor[] descriptors)
protected static java.util.Map<java.lang.String,PropertyDescriptor> asFixedMap(PropertyDescriptor descriptor)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||