net.sourceforge.pmd
Class AbstractDelegateRule

java.lang.Object
  extended by net.sourceforge.pmd.AbstractDelegateRule
All Implemented Interfaces:
Rule
Direct Known Subclasses:
RuleReference

public class AbstractDelegateRule
extends java.lang.Object
implements Rule

Base class for Rule implementations which delegate to another Rule instance.


Field Summary
 
Fields inherited from interface net.sourceforge.pmd.Rule
LOWEST_PRIORITY, PRIORITIES
 
Constructor Summary
AbstractDelegateRule()
           
 
Method Summary
 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()
          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 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.
 Rule getRule()
           
 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()
          TODO What is this?
 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 url)
          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 setRule(Rule 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDelegateRule

public AbstractDelegateRule()
Method Detail

setRule

public void setRule(Rule rule)

getRule

public Rule getRule()

getName

public java.lang.String getName()
Description copied from interface: Rule
Get the name of this Rule.

Specified by:
getName in interface Rule

setName

public void setName(java.lang.String name)
Description copied from interface: Rule
Set the name of this Rule.

Specified by:
setName in interface Rule

getSince

public java.lang.String getSince()
Description copied from interface: Rule
Get the version of PMD in which this Rule was added. Return null if not applicable.

Specified by:
getSince in interface Rule

setSince

public void setSince(java.lang.String since)
Description copied from interface: Rule
Set the version of PMD in which this Rule was added.

Specified by:
setSince in interface Rule

getRuleClass

public java.lang.String getRuleClass()
Description copied from interface: Rule
Get the class of this Rule.

Specified by:
getRuleClass in interface Rule

setRuleClass

public void setRuleClass(java.lang.String ruleClass)
Description copied from interface: Rule
Set the class of this Rule.

Specified by:
setRuleClass in interface Rule

getRuleSetName

public java.lang.String getRuleSetName()
Description copied from interface: Rule
Get the name of the RuleSet containing this Rule.

Specified by:
getRuleSetName in interface Rule
See Also:
RuleSet

setRuleSetName

public void setRuleSetName(java.lang.String name)
Description copied from interface: Rule
Set the name of the RuleSet containing this Rule.

Specified by:
setRuleSetName in interface Rule
See Also:
RuleSet

getMessage

public java.lang.String getMessage()
Description copied from interface: Rule
Get the message to show when this Rule identifies a violation.

Specified by:
getMessage in interface Rule

setMessage

public void setMessage(java.lang.String message)
Description copied from interface: Rule
Set the message to show when this Rule identifies a violation.

Specified by:
setMessage in interface Rule

getDescription

public java.lang.String getDescription()
Description copied from interface: Rule
Get the description of this Rule.

Specified by:
getDescription in interface Rule

setDescription

public void setDescription(java.lang.String description)
Description copied from interface: Rule
Set the description of this Rule.

Specified by:
setDescription in interface Rule

getExamples

public java.util.List<java.lang.String> getExamples()
Description copied from interface: Rule
Get the list of examples for this Rule.

Specified by:
getExamples in interface Rule

getExample

public java.lang.String getExample()
Description copied from interface: Rule
Still used by the JDeveloper plugin

Specified by:
getExample in interface Rule

addExample

public void addExample(java.lang.String example)
Description copied from interface: Rule
Add a single example for this Rule.

Specified by:
addExample in interface Rule

getExternalInfoUrl

public java.lang.String getExternalInfoUrl()
Description copied from interface: Rule
Get a URL for external information about this Rule.

Specified by:
getExternalInfoUrl in interface Rule

setExternalInfoUrl

public void setExternalInfoUrl(java.lang.String url)
Description copied from interface: Rule
Set a URL for external information about this Rule.

Specified by:
setExternalInfoUrl in interface Rule

getPriority

public int getPriority()
Description copied from interface: Rule
Get the priority of this Rule.

Specified by:
getPriority in interface Rule

setPriority

public void setPriority(int priority)
Description copied from interface: Rule
Set the priority of this Rule.

Specified by:
setPriority in interface Rule

getPriorityName

public java.lang.String getPriorityName()
Description copied from interface: Rule
Get a name for the priority of this Rule.

Specified by:
getPriorityName in interface Rule

include

public boolean include()
Description copied from interface: Rule
TODO What is this?

Specified by:
include in interface Rule

setInclude

public void setInclude(boolean include)
Description copied from interface: Rule
TODO What is this?

Specified by:
setInclude in interface Rule

getProperties

public java.util.Properties getProperties()
Description copied from interface: Rule
Get all properties for this Rule.

Specified by:
getProperties in interface Rule
Returns:
the properties for the rule

addProperty

public void addProperty(java.lang.String name,
                        java.lang.String property)
Description copied from interface: Rule
Add a specific property to this Rule.

Specified by:
addProperty in interface Rule

addProperties

public void addProperties(java.util.Properties properties)
Description copied from interface: Rule
Add a set of properties to this Rule.

Specified by:
addProperties in interface Rule

hasProperty

public boolean hasProperty(java.lang.String name)
Description copied from interface: Rule
Get whether this Rule has a property of the given name.

Specified by:
hasProperty in interface Rule

getBooleanProperty

public boolean getBooleanProperty(java.lang.String name)
Description copied from interface: Rule
Get the boolean value for the given property.

Specified by:
getBooleanProperty in interface Rule

getIntProperty

public int getIntProperty(java.lang.String name)
Description copied from interface: Rule
Get the int value for the given property.

Specified by:
getIntProperty in interface Rule

getDoubleProperty

public double getDoubleProperty(java.lang.String name)
Description copied from interface: Rule
Get the double value for the given property.

Specified by:
getDoubleProperty in interface Rule

getStringProperty

public java.lang.String getStringProperty(java.lang.String name)
Description copied from interface: Rule
Get the java.util.String value for the given property.

Specified by:
getStringProperty in interface Rule

propertyDescriptorFor

public PropertyDescriptor propertyDescriptorFor(java.lang.String name)
Description copied from interface: Rule
Get the PropertyDescriptor for the given property.

Specified by:
propertyDescriptorFor in interface Rule

setUsesDFA

public void setUsesDFA()
Description copied from interface: Rule
Sets whether this Rule uses Data Flow Analysis.

Specified by:
setUsesDFA in interface Rule

usesDFA

public boolean usesDFA()
Description copied from interface: Rule
Gets whether this Rule uses Data Flow Analysis.

Specified by:
usesDFA in interface Rule

setUsesTypeResolution

public void setUsesTypeResolution()
Description copied from interface: Rule
Sets whether this Rule uses Type Resolution.

Specified by:
setUsesTypeResolution in interface Rule

usesTypeResolution

public boolean usesTypeResolution()
Description copied from interface: Rule
Gets whether this Rule uses Type Resolution.

Specified by:
usesTypeResolution in interface Rule

usesRuleChain

public boolean usesRuleChain()
Description copied from interface: Rule
Gets whether this Rule uses the RuleChain.

Specified by:
usesRuleChain in interface Rule

getRuleChainVisits

public java.util.List<java.lang.String> getRuleChainVisits()
Description copied from interface: Rule
Gets the collection of AST node names visited by the Rule on the RuleChain.

Specified by:
getRuleChainVisits in interface Rule

addRuleChainVisit

public void addRuleChainVisit(java.lang.String astNodeName)
Description copied from interface: Rule
Adds an AST node name to be visited by the Rule on the RuleChain.

Specified by:
addRuleChainVisit in interface Rule

start

public void start(RuleContext ctx)
Description copied from interface: Rule
Start processing. Called once, before apply() is first called.

Specified by:
start in interface Rule

apply

public void apply(java.util.List astCompilationUnits,
                  RuleContext ctx)
Description copied from interface: Rule
Apply this rule to the given collection of compilation units, using the given context.

Specified by:
apply in interface Rule

end

public void end(RuleContext ctx)
Description copied from interface: Rule
End processing. Called once, after apply() is last called.

Specified by:
end in interface Rule


Copyright © 2002-2011 InfoEther. All Rights Reserved.