Class AbstractDelegateRule

    • Constructor Detail

      • AbstractDelegateRule

        public AbstractDelegateRule()
        Deprecated.
    • Method Detail

      • getRule

        public Rule getRule()
        Deprecated.
      • setRule

        @Deprecated
        public void setRule​(Rule rule)
        Deprecated.
        This will be removed in 7.0.0 I mark it specially deprecated because it's inherited by rule reference, even though a RuleReference has no business setting its rule after construction
      • getLanguage

        public Language getLanguage()
        Deprecated.
        Description copied from interface: Rule
        Get the Language of this Rule.
        Specified by:
        getLanguage in interface Rule
        Returns:
        the language
      • setLanguage

        public void setLanguage​(Language language)
        Deprecated.
        Description copied from interface: Rule
        Set the Language of this Rule.
        Specified by:
        setLanguage in interface Rule
        Parameters:
        language - the language
      • getMinimumLanguageVersion

        public LanguageVersion getMinimumLanguageVersion()
        Deprecated.
        Description copied from interface: Rule
        Get the minimum LanguageVersion to which this Rule applies. If this value is null it indicates there is no minimum bound.
        Specified by:
        getMinimumLanguageVersion in interface Rule
        Returns:
        the minimum language version
      • setMinimumLanguageVersion

        public void setMinimumLanguageVersion​(LanguageVersion minimumlanguageVersion)
        Deprecated.
        Description copied from interface: Rule
        Set the minimum LanguageVersion to which this Rule applies.
        Specified by:
        setMinimumLanguageVersion in interface Rule
        Parameters:
        minimumlanguageVersion - the minimum language version
      • getMaximumLanguageVersion

        public LanguageVersion getMaximumLanguageVersion()
        Deprecated.
        Description copied from interface: Rule
        Get the maximum LanguageVersion to which this Rule applies. If this value is null it indicates there is no maximum bound.
        Specified by:
        getMaximumLanguageVersion in interface Rule
        Returns:
        the maximum language version
      • setMaximumLanguageVersion

        public void setMaximumLanguageVersion​(LanguageVersion maximumlanguageVersion)
        Deprecated.
        Description copied from interface: Rule
        Set the maximum LanguageVersion to which this Rule applies.
        Specified by:
        setMaximumLanguageVersion in interface Rule
        Parameters:
        maximumlanguageVersion - the maximum language version
      • isDeprecated

        public boolean isDeprecated()
        Deprecated.
        Description copied from interface: Rule
        Gets whether this Rule is deprecated. A deprecated Rule is one which:
        • is scheduled for removal in a future version of PMD
        • or, has been removed and replaced with a non-functioning place-holder and will be completely removed in a future version of PMD
        • or, has been renamed/moved and the old name will be completely removed in a future version of PMD
        Specified by:
        isDeprecated in interface Rule
        Returns:
        true if this rule is deprecated
      • setDeprecated

        public void setDeprecated​(boolean deprecated)
        Deprecated.
        Description copied from interface: Rule
        Sets whether this Rule is deprecated.
        Specified by:
        setDeprecated in interface Rule
        Parameters:
        deprecated - whether this rule is deprecated
      • ignoredProperties

        public Set<PropertyDescriptor<?>> ignoredProperties()
        Deprecated.
        Description copied from interface: PropertySource
        Return the properties that are effectively ignored due to the configuration of the rule and values held by other properties. This can be used to disable corresponding widgets in a UI.
        Specified by:
        ignoredProperties in interface PropertySource
        Returns:
        the properties that are ignored
      • getName

        public String getName()
        Deprecated.
        Description copied from interface: Rule
        Get the name of this Rule.
        Specified by:
        getName in interface PropertySource
        Specified by:
        getName in interface Rule
        Returns:
        the name
      • setName

        public void setName​(String name)
        Deprecated.
        Description copied from interface: Rule
        Set the name of this Rule.
        Specified by:
        setName in interface Rule
        Parameters:
        name - the name
      • getSince

        public String getSince()
        Deprecated.
        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
        Returns:
        version of PMD since when this rule was added
      • setSince

        public void setSince​(String since)
        Deprecated.
        Description copied from interface: Rule
        Set the version of PMD in which this Rule was added.
        Specified by:
        setSince in interface Rule
        Parameters:
        since - the version of PMD since when this rule was added
      • getRuleClass

        public String getRuleClass()
        Deprecated.
        Description copied from interface: Rule
        Get the implementation class of this Rule.
        Specified by:
        getRuleClass in interface Rule
        Returns:
        the implementation class name of this rule.
      • setRuleClass

        public void setRuleClass​(String ruleClass)
        Deprecated.
        Description copied from interface: Rule
        Set the class of this Rule.
        Specified by:
        setRuleClass in interface Rule
        Parameters:
        ruleClass - the class name of this rule.
      • getRuleSetName

        public String getRuleSetName()
        Deprecated.
        Description copied from interface: Rule
        Get the name of the RuleSet containing this Rule.
        Specified by:
        getRuleSetName in interface Rule
        Returns:
        the name of th ruleset containing this rule.
        See Also:
        RuleSet
      • setRuleSetName

        public void setRuleSetName​(String name)
        Deprecated.
        Description copied from interface: Rule
        Set the name of the RuleSet containing this Rule.
        Specified by:
        setRuleSetName in interface Rule
        Parameters:
        name - the name of the ruleset containing this rule.
        See Also:
        RuleSet
      • getMessage

        public String getMessage()
        Deprecated.
        Description copied from interface: Rule
        Get the message to show when this Rule identifies a violation.
        Specified by:
        getMessage in interface Rule
        Returns:
        the message to show for a violation.
      • setMessage

        public void setMessage​(String message)
        Deprecated.
        Description copied from interface: Rule
        Set the message to show when this Rule identifies a violation.
        Specified by:
        setMessage in interface Rule
        Parameters:
        message - the message to show for a violation.
      • getDescription

        public String getDescription()
        Deprecated.
        Description copied from interface: Rule
        Get the description of this Rule.
        Specified by:
        getDescription in interface Rule
        Returns:
        the description
      • setDescription

        public void setDescription​(String description)
        Deprecated.
        Description copied from interface: Rule
        Set the description of this Rule.
        Specified by:
        setDescription in interface Rule
        Parameters:
        description - the description
      • getExamples

        public List<String> getExamples()
        Deprecated.
        Description copied from interface: Rule
        Get the list of examples for this Rule.
        Specified by:
        getExamples in interface Rule
        Returns:
        the list of examples for this rule.
      • addExample

        public void addExample​(String example)
        Deprecated.
        Description copied from interface: Rule
        Add a single example for this Rule.
        Specified by:
        addExample in interface Rule
        Parameters:
        example - a single example to add
      • getExternalInfoUrl

        public String getExternalInfoUrl()
        Deprecated.
        Description copied from interface: Rule
        Get a URL for external information about this Rule.
        Specified by:
        getExternalInfoUrl in interface Rule
        Returns:
        the URL for external information about this rule.
      • setExternalInfoUrl

        public void setExternalInfoUrl​(String url)
        Deprecated.
        Description copied from interface: Rule
        Set a URL for external information about this Rule.
        Specified by:
        setExternalInfoUrl in interface Rule
        Parameters:
        url - the URL for external information about this rule.
      • getPriority

        public RulePriority getPriority()
        Deprecated.
        Description copied from interface: Rule
        Get the priority of this Rule.
        Specified by:
        getPriority in interface Rule
        Returns:
        the priority
      • setPriority

        public void setPriority​(RulePriority priority)
        Deprecated.
        Description copied from interface: Rule
        Set the priority of this Rule.
        Specified by:
        setPriority in interface Rule
        Parameters:
        priority - the priority
      • getParserOptions

        public ParserOptions getParserOptions()
        Deprecated.
        Description copied from interface: Rule
        Get the parser options for this Rule. Parser options are used to configure the Parser to create an AST in the form the Rule is expecting. Because ParserOptions are mutable, a Rule should return a new instance on each call.
        Specified by:
        getParserOptions in interface Rule
        Returns:
        the parser options
      • getPropertyDescriptor

        public PropertyDescriptor<?> getPropertyDescriptor​(String name)
        Deprecated.
        Description copied from interface: PropertySource
        Get the PropertyDescriptor for the given property name.
        Specified by:
        getPropertyDescriptor in interface PropertySource
        Parameters:
        name - The name of the property.
        Returns:
        The PropertyDescriptor for the named property, null if there is no such property defined.
      • getProperty

        public <T> T getProperty​(PropertyDescriptor<T> propertyDescriptor)
        Deprecated.
        Description copied from interface: PropertySource
        Get the typed value for the given property. Multi valued properties return immutable lists.
        Specified by:
        getProperty in interface PropertySource
        Type Parameters:
        T - The underlying type of the property descriptor.
        Parameters:
        propertyDescriptor - The property descriptor.
        Returns:
        The property value.
      • setProperty

        public <T> void setProperty​(PropertyDescriptor<T> propertyDescriptor,
                                    T value)
        Deprecated.
        Description copied from interface: PropertySource
        Set the property value specified. This is also referred to as "overriding" the (default) value of a property.
        Specified by:
        setProperty in interface PropertySource
        Type Parameters:
        T - The underlying type of the property descriptor.
        Parameters:
        propertyDescriptor - The property descriptor.
        value - The value to set.
      • setProperty

        public <V> void setProperty​(MultiValuePropertyDescriptor<V> propertyDescriptor,
                                    V... values)
        Deprecated.
        Description copied from interface: PropertySource
        Sets the value of a multi value property descriptor with a variable number of arguments. This is also referred to as "overriding" the (default) value of a property.
        Specified by:
        setProperty in interface PropertySource
        Type Parameters:
        V - The type of the values
        Parameters:
        propertyDescriptor - The property descriptor for which to add a value
        values - Values
      • isPropertyOverridden

        public boolean isPropertyOverridden​(PropertyDescriptor<?> propertyDescriptor)
        Deprecated.
        Description copied from interface: PropertySource
        Returns true if the given property has been set to a value somewhere in the XML.
        Specified by:
        isPropertyOverridden in interface PropertySource
        Parameters:
        propertyDescriptor - The descriptor
        Returns:
        True if the property has been set
      • setUsesDFA

        @Deprecated
        public void setUsesDFA()
        Deprecated.
        Description copied from interface: Rule
        Sets whether this Rule uses Data Flow Analysis.
        Specified by:
        setUsesDFA in interface Rule
      • setDfa

        public void setDfa​(boolean isDfa)
        Deprecated.
        Description copied from interface: Rule
        Sets whether this Rule uses Data Flow Analysis.
        Specified by:
        setDfa in interface Rule
      • usesDFA

        @Deprecated
        public boolean usesDFA()
        Deprecated.
        Description copied from interface: Rule
        Gets whether this Rule uses Data Flow Analysis.
        Specified by:
        usesDFA in interface Rule
        Returns:
        true if Data Flow Analysis is used.
      • isDfa

        public boolean isDfa()
        Deprecated.
        Description copied from interface: Rule
        Gets whether this Rule uses Data Flow Analysis.
        Specified by:
        isDfa in interface Rule
        Returns:
        true if Data Flow Analysis is used.
      • setUsesTypeResolution

        @Deprecated
        public void setUsesTypeResolution()
        Deprecated.
        Description copied from interface: Rule
        Sets whether this Rule uses Type Resolution.
        Specified by:
        setUsesTypeResolution in interface Rule
      • setTypeResolution

        public void setTypeResolution​(boolean usingTypeResolution)
        Deprecated.
        Description copied from interface: Rule
        Sets whether this Rule uses Type Resolution.
        Specified by:
        setTypeResolution in interface Rule
      • usesTypeResolution

        @Deprecated
        public boolean usesTypeResolution()
        Deprecated.
        Description copied from interface: Rule
        Gets whether this Rule uses Type Resolution.
        Specified by:
        usesTypeResolution in interface Rule
        Returns:
        true if Type Resolution is used.
      • isTypeResolution

        public boolean isTypeResolution()
        Deprecated.
        Description copied from interface: Rule
        Gets whether this Rule uses Type Resolution.
        Specified by:
        isTypeResolution in interface Rule
        Returns:
        true if Type Resolution is used.
      • setUsesMultifile

        @Deprecated
        public void setUsesMultifile()
        Deprecated.
        Description copied from interface: Rule
        Sets whether this Rule uses multi-file analysis.
        Specified by:
        setUsesMultifile in interface Rule
      • setMultifile

        public void setMultifile​(boolean multifile)
        Deprecated.
        Description copied from interface: Rule
        Sets whether this Rule uses multi-file analysis.
        Specified by:
        setMultifile in interface Rule
      • usesMultifile

        @Deprecated
        public boolean usesMultifile()
        Deprecated.
        Description copied from interface: Rule
        Gets whether this Rule uses multi-file analysis.
        Specified by:
        usesMultifile in interface Rule
        Returns:
        true if the multi file analysis is used.
      • isMultifile

        public boolean isMultifile()
        Deprecated.
        Description copied from interface: Rule
        Gets whether this Rule uses multi-file analysis.
        Specified by:
        isMultifile in interface Rule
        Returns:
        true if the multi file analysis is used.
      • usesRuleChain

        @Deprecated
        public boolean usesRuleChain()
        Deprecated.
        Description copied from interface: Rule
        Gets whether this Rule uses the RuleChain.
        Specified by:
        usesRuleChain in interface Rule
        Returns:
        true if RuleChain is used.
      • isRuleChain

        public boolean isRuleChain()
        Deprecated.
        Description copied from interface: Rule
        Gets whether this Rule uses the RuleChain.
        Specified by:
        isRuleChain in interface Rule
        Returns:
        true if RuleChain is used.
      • getRuleChainVisits

        public List<String> getRuleChainVisits()
        Deprecated.
        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
        Returns:
        the list of AST node names
      • addRuleChainVisit

        public void addRuleChainVisit​(Class<? extends Node> nodeClass)
        Deprecated.
        Description copied from interface: Rule
        Adds an AST node by class to be visited by the Rule on the RuleChain.
        Specified by:
        addRuleChainVisit in interface Rule
        Parameters:
        nodeClass - the AST node to add to the RuleChain visit list
      • addRuleChainVisit

        public void addRuleChainVisit​(String astNodeName)
        Deprecated.
        Description copied from interface: Rule
        Adds an AST node by name to be visited by the Rule on the RuleChain.
        Specified by:
        addRuleChainVisit in interface Rule
        Parameters:
        astNodeName - the AST node to add to the RuleChain visit list as string
      • start

        public void start​(RuleContext ctx)
        Deprecated.
        Description copied from interface: Rule
        Start processing. Called once, before apply() is first called.
        Specified by:
        start in interface Rule
        Parameters:
        ctx - the rule context
      • apply

        public void apply​(List<? extends Node> nodes,
                          RuleContext ctx)
        Deprecated.
        Description copied from interface: Rule
        Apply this rule to the given collection of nodes, using the given context.
        Specified by:
        apply in interface Rule
        Parameters:
        nodes - the nodes
        ctx - the rule context
      • end

        public void end​(RuleContext ctx)
        Deprecated.
        Description copied from interface: Rule
        End processing. Called once, after apply() is last called.
        Specified by:
        end in interface Rule
        Parameters:
        ctx - the rule context