net.sourceforge.pmd
Interface Rule

All Known Implementing Classes:
AbstractInefficientZeroCheck, AbstractJspRule, AbstractJUnitRule, AbstractNcssCount, AbstractOptimizationRule, AbstractPoorMethodCall, AbstractRule, AbstractSunSecureRule, AccessorClassGeneration, AppendCharacterWithChar, ArrayIsStoredDirectly, AssignmentInOperand, AssignmentToNonFinalStatic, AvoidCallingFinalize, AvoidCatchingThrowable, AvoidDeeplyNestedIfStmtsRule, AvoidDollarSigns, AvoidDuplicateLiteralsRule, AvoidFieldNameMatchingMethodName, AvoidFieldNameMatchingTypeName, AvoidInstantiatingObjectsInLoops, AvoidNonConstructorMethodsWithClassName, AvoidReassigningParameters, AvoidUsingOctalValues, BeanMembersShouldSerializeRule, BigIntegerInstantiation, BooleanInstantiation, BrokenNullCheck, ClassNamingConventions, CloneMethodMustImplementCloneable, CloseResource, CommonAbstractRule, CompareObjectsWithEquals, ConfusingTernary, ConsecutiveLiteralAppends, ConstructorCallsOverridableMethod, CouplingBetweenObjects, CyclomaticComplexity, DaaRule, DFAGraphRule, DontImportJavaLang, DontImportSun, DoubleCheckedLocking, DuplicateImportsRule, DuplicateJspImports, ExceptionAsFlowControl, ExceptionSignatureDeclaration, ExcessiveImports, ExcessiveLengthRule, ExcessiveNodeCountRule, ExcessivePublicCount, IdempotentOperations, ImmutableField, ImportFromSamePackageRule, InefficientEmptyStringCheck, InefficientStringBuffering, InsufficientStringBufferDeclaration, JUnitAssertionsShouldIncludeMessage, JUnitTestsShouldContainAsserts, JUnitUseExpected, LocalVariableCouldBeFinal, LongClassRule, LongMethodRule, LongParameterListRule, LooseCoupling, LooseCoupling, MethodArgumentCouldBeFinal, MethodNamingConventions, MethodReturnsInternalArray, MethodWithSameNameAsEnclosingClass, MoreThanOneLogger, NcssConstructorCount, NcssMethodCount, NcssTypeCount, NoInlineStyleInformation, NonThreadSafeSingleton, NpathComplexity, NullAssignmentRule, OnlyOneReturnRule, OverrideBothEqualsAndHashcode, PositionalIteratorRule, PreserveStackTrace, SignatureDeclareThrowsException, SimplifyBooleanReturns, SingularField, StatisticalRule, StringConcatenationRule, StringInstantiation, StringToStringRule, SuspiciousHashcodeMethodName, SuspiciousOctalEscape, SwitchDensityRule, SymbolTableTestRule, TestClassWithoutTestCases, TooManyFields, UnnecessaryCaseChange, UnnecessaryCast, UnnecessaryConversionTemporary, UnnecessaryLocalBeforeReturn, UnnecessaryReturn, UnnecessaryWrapperObjectCreation, UnsynchronizedStaticDateFormatter, UnusedFormalParameterRule, UnusedImports, UnusedImportsRule, UnusedLocalVariableRule, UnusedModifier, UnusedPrivateFieldRule, UnusedPrivateMethodRule, UseCollectionIsEmpty, UseIndexOfChar, UselessAssignment, UselessOperationOnImmutable, UselessOverridingMethod, UselessStringValueOf, UseSingleton, UseStringBufferForStringAppends, UseStringBufferLength, VariableNamingConventions, XPathRule

public interface Rule


Field Summary
static int LOWEST_PRIORITY
           
static java.lang.String[] PRIORITIES
           
 
Method Summary
 void addExample(java.lang.String example)
           
 void addProperties(java.util.Properties properties)
           
 void addProperty(java.lang.String name, java.lang.String property)
           
 void addRuleChainVisit(java.lang.String astNodeName)
           
 void apply(java.util.List astCompilationUnits, RuleContext ctx)
           
 boolean getBooleanProperty(java.lang.String name)
           
 java.lang.String getDescription()
           
 double getDoubleProperty(java.lang.String name)
           
 java.lang.String getExample()
          Deprecated. use getExamples(), since we now support multiple examples
 java.util.List<java.lang.String> getExamples()
           
 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.util.List<java.lang.String> getRuleChainVisits()
           
 java.lang.String getRuleSetName()
           
 java.lang.String getStringProperty(java.lang.String name)
           
 boolean hasProperty(java.lang.String name)
           
 boolean include()
           
 PropertyDescriptor propertyDescriptorFor(java.lang.String name)
           
 void setDescription(java.lang.String description)
           
 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 name)
           
 void setUsesDFA()
           
 void setUsesTypeResolution()
           
 boolean usesDFA()
           
 boolean usesRuleChain()
           
 boolean usesTypeResolution()
           
 

Field Detail

LOWEST_PRIORITY

static final int LOWEST_PRIORITY
See Also:
Constant Field Values

PRIORITIES

static final java.lang.String[] PRIORITIES
Method Detail

getName

java.lang.String getName()

getMessage

java.lang.String getMessage()

getDescription

java.lang.String getDescription()

getExamples

java.util.List<java.lang.String> getExamples()

getExample

java.lang.String getExample()
Deprecated. use getExamples(), since we now support multiple examples

Still used by the JDeveloper plugin


getExternalInfoUrl

java.lang.String getExternalInfoUrl()

setName

void setName(java.lang.String name)

getRuleSetName

java.lang.String getRuleSetName()

setRuleSetName

void setRuleSetName(java.lang.String name)

setMessage

void setMessage(java.lang.String message)

setDescription

void setDescription(java.lang.String description)

addExample

void addExample(java.lang.String example)

setExternalInfoUrl

void setExternalInfoUrl(java.lang.String url)

apply

void apply(java.util.List astCompilationUnits,
           RuleContext ctx)

hasProperty

boolean hasProperty(java.lang.String name)

addProperty

void addProperty(java.lang.String name,
                 java.lang.String property)

addProperties

void addProperties(java.util.Properties properties)

getIntProperty

int getIntProperty(java.lang.String name)

getBooleanProperty

boolean getBooleanProperty(java.lang.String name)

getStringProperty

java.lang.String getStringProperty(java.lang.String name)

getDoubleProperty

double getDoubleProperty(java.lang.String name)

getProperties

java.util.Properties getProperties()

include

boolean include()

setInclude

void setInclude(boolean include)

getPriority

int getPriority()

getPriorityName

java.lang.String getPriorityName()

setPriority

void setPriority(int priority)

setUsesDFA

void setUsesDFA()

usesDFA

boolean usesDFA()

propertyDescriptorFor

PropertyDescriptor propertyDescriptorFor(java.lang.String name)

setUsesTypeResolution

void setUsesTypeResolution()

usesTypeResolution

boolean usesTypeResolution()

usesRuleChain

boolean usesRuleChain()

getRuleChainVisits

java.util.List<java.lang.String> getRuleChainVisits()

addRuleChainVisit

void addRuleChainVisit(java.lang.String astNodeName)