|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.pmd.CommonAbstractRule
Basic abstract implementation of all parser-independent methods of the Rule interface.
| Field Summary | |
protected java.lang.String |
description
|
protected java.lang.String |
example
|
protected java.lang.String |
externalInfoUrl
|
protected boolean |
include
|
protected java.lang.String |
message
|
protected java.lang.String |
name
|
protected int |
priority
|
protected java.util.Properties |
properties
|
protected java.lang.String |
ruleSetName
|
protected boolean |
usesDFA
|
protected boolean |
usesTypeResolution
|
| Fields inherited from interface net.sourceforge.pmd.Rule |
LOWEST_PRIORITY, PRIORITIES |
| Constructor Summary | |
CommonAbstractRule()
|
|
| Method Summary | |
void |
addProperties(java.util.Properties properties)
|
void |
addProperty(java.lang.String name,
java.lang.String value)
|
protected void |
addViolation(java.lang.Object data,
Node node,
java.lang.Object[] args)
Adds a violation to the report. |
protected void |
addViolation(java.lang.Object data,
SimpleNode node)
Adds a violation to the report. |
protected void |
addViolation(java.lang.Object data,
SimpleNode node,
java.lang.String embed)
Adds a violation to the report. |
protected void |
addViolationWithMessage(java.lang.Object data,
SimpleNode node,
java.lang.String msg)
Adds a violation to the report. |
boolean |
equals(java.lang.Object o)
Test if rules are equals. |
boolean |
getBooleanProperty(java.lang.String name)
|
java.lang.String |
getDescription()
|
double |
getDoubleProperty(java.lang.String name)
|
java.lang.String |
getExample()
|
java.lang.String |
getExternalInfoUrl()
|
int |
getIntProperty(java.lang.String name)
|
java.lang.String |
getMessage()
|
java.lang.String |
getName()
|
int |
getPriority()
|
java.lang.String |
getPriorityName()
|
java.util.Properties |
getProperties()
|
java.lang.String |
getRuleSetName()
|
java.lang.String |
getStringProperty(java.lang.String name)
|
int |
hashCode()
Return a hash code to conform to equality. |
boolean |
hasProperty(java.lang.String name)
|
boolean |
include()
|
PropertyDescriptor |
propertyDescriptorFor(java.lang.String name)
|
void |
setDescription(java.lang.String description)
|
void |
setExample(java.lang.String example)
|
void |
setExternalInfoUrl(java.lang.String url)
|
void |
setInclude(boolean include)
|
void |
setMessage(java.lang.String message)
|
void |
setName(java.lang.String name)
|
void |
setPriority(int priority)
|
void |
setRuleSetName(java.lang.String ruleSetName)
|
void |
setUsesDFA()
|
void |
setUsesTypeResolution()
|
boolean |
usesDFA()
|
boolean |
usesTypeResolution()
|
| 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 |
| Field Detail |
protected java.lang.String name
protected java.util.Properties properties
protected java.lang.String message
protected java.lang.String description
protected java.lang.String example
protected java.lang.String ruleSetName
protected boolean include
protected boolean usesDFA
protected boolean usesTypeResolution
protected int priority
protected java.lang.String externalInfoUrl
| Constructor Detail |
public CommonAbstractRule()
| Method Detail |
public java.lang.String getRuleSetName()
getRuleSetName in interface Rulepublic void setRuleSetName(java.lang.String ruleSetName)
setRuleSetName in interface Rulepublic java.lang.String getDescription()
getDescription in interface Rulepublic void setDescription(java.lang.String description)
setDescription in interface Rulepublic java.lang.String getExample()
getExample in interface Rulepublic void setExample(java.lang.String example)
setExample in interface Rulepublic boolean hasProperty(java.lang.String name)
hasProperty in interface Rule
public void addProperty(java.lang.String name,
java.lang.String value)
addProperty in interface Rulepublic void addProperties(java.util.Properties properties)
addProperties in interface Rulepublic double getDoubleProperty(java.lang.String name)
getDoubleProperty in interface Rulepublic int getIntProperty(java.lang.String name)
getIntProperty in interface Rulepublic boolean getBooleanProperty(java.lang.String name)
getBooleanProperty in interface Rulepublic java.lang.String getStringProperty(java.lang.String name)
getStringProperty in interface Rulepublic java.lang.String getName()
getName in interface Rulepublic void setName(java.lang.String name)
setName in interface Rulepublic java.lang.String getMessage()
getMessage in interface Rulepublic void setMessage(java.lang.String message)
setMessage in interface Rulepublic java.lang.String getExternalInfoUrl()
getExternalInfoUrl in interface Rulepublic void setExternalInfoUrl(java.lang.String url)
setExternalInfoUrl in interface Rulepublic boolean equals(java.lang.Object o)
public int hashCode()
public java.util.Properties getProperties()
getProperties in interface Rulepublic boolean include()
include in interface Rulepublic void setInclude(boolean include)
setInclude in interface Rulepublic int getPriority()
getPriority in interface Rulepublic java.lang.String getPriorityName()
getPriorityName in interface Rulepublic void setPriority(int priority)
setPriority in interface Rulepublic void setUsesDFA()
setUsesDFA in interface Rulepublic boolean usesDFA()
usesDFA in interface Rulepublic void setUsesTypeResolution()
setUsesTypeResolution in interface Rulepublic boolean usesTypeResolution()
usesTypeResolution in interface Rule
protected final void addViolation(java.lang.Object data,
SimpleNode node)
node - the node that produces the violation
protected final void addViolationWithMessage(java.lang.Object data,
SimpleNode node,
java.lang.String msg)
node - the node that produces the violationmsg - specific message to put in the report
protected final void addViolation(java.lang.Object data,
SimpleNode node,
java.lang.String embed)
node - the node that produces the violationembed - a variable to embed in the rule violation message
protected final void addViolation(java.lang.Object data,
Node node,
java.lang.Object[] args)
node - the node that produces the violation, may be null, in which case all line and column info will be set to zeroargs - objects to embed in the rule violation messagepublic PropertyDescriptor propertyDescriptorFor(java.lang.String name)
propertyDescriptorFor in interface Rule
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||