PropertySource
, Rule
public class RuleReference extends AbstractDelegateRule
VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR
Constructor | Description |
---|---|
RuleReference() |
Deprecated.
|
RuleReference(Rule theRule,
RuleSetReference theRuleSetReference) |
Modifier and Type | Method | Description |
---|---|---|
void |
addExample(java.lang.String example) |
Add a single example for this Rule.
|
Rule |
deepCopy() |
Creates a new copy of this rule.
|
void |
definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor) |
Define a new property via a PropertyDescriptor.
|
java.lang.String |
getName() |
Get the name of this Rule.
|
java.lang.String |
getOriginalName() |
|
java.lang.String |
getOverriddenDescription() |
|
java.util.List<java.lang.String> |
getOverriddenExamples() |
|
java.lang.String |
getOverriddenExternalInfoUrl() |
|
Language |
getOverriddenLanguage() |
|
LanguageVersion |
getOverriddenMaximumLanguageVersion() |
|
java.lang.String |
getOverriddenMessage() |
|
LanguageVersion |
getOverriddenMinimumLanguageVersion() |
|
java.lang.String |
getOverriddenName() |
|
RulePriority |
getOverriddenPriority() |
|
java.util.Map<PropertyDescriptor<?>,java.lang.Object> |
getOverriddenPropertiesByPropertyDescriptor() |
|
java.util.List<PropertyDescriptor<?>> |
getOverriddenPropertyDescriptors() |
|
RuleSetReference |
getRuleSetReference() |
|
boolean |
hasDescriptor(PropertyDescriptor<?> descriptor) |
Returns whether this Rule has the specified PropertyDescriptor.
|
boolean |
hasOverriddenProperty(PropertyDescriptor<?> descriptor) |
|
boolean |
isDeprecated() |
Gets whether this Rule is deprecated.
|
java.lang.Boolean |
isOverriddenDeprecated() |
|
void |
setDeprecated(boolean deprecated) |
Sets whether this Rule is deprecated.
|
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 |
setLanguage(Language language) |
Set the Language of this Rule.
|
void |
setMaximumLanguageVersion(LanguageVersion maximumLanguageVersion) |
Set the maximum LanguageVersion to which this Rule applies.
|
void |
setMessage(java.lang.String message) |
Set the message to show when this Rule identifies a violation.
|
void |
setMinimumLanguageVersion(LanguageVersion minimumLanguageVersion) |
Set the minimum LanguageVersion to which this Rule applies.
|
void |
setName(java.lang.String name) |
Set the name of this Rule.
|
void |
setPriority(RulePriority priority) |
Set the priority of this Rule.
|
<T> void |
setProperty(PropertyDescriptor<T> propertyDescriptor,
T value) |
Set the property value specified (will be type-checked)
|
void |
setRuleSetReference(RuleSetReference ruleSetReference) |
|
void |
useDefaultValueFor(PropertyDescriptor<?> desc) |
Clears out any user-specified value for the property allowing it to use the default value in the descriptor.
|
boolean |
usesDefaultValues() |
Returns whether this Rule uses default values for properties.
|
addRuleChainVisit, addRuleChainVisit, apply, dysfunctionReason, end, getDescription, getExamples, getExternalInfoUrl, getLanguage, getMaximumLanguageVersion, getMessage, getMinimumLanguageVersion, getParserOptions, getPriority, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, getRule, getRuleChainVisits, getRuleClass, getRuleSetName, getSince, ignoredProperties, isDfa, isMultifile, isRuleChain, isTypeResolution, setDfa, setMultifile, setProperty, setRule, setRuleClass, setRuleSetName, setSince, setTypeResolution, setUsesDFA, setUsesMultifile, setUsesTypeResolution, start, usesDFA, usesMultifile, usesRuleChain, usesTypeResolution
@Deprecated public RuleReference()
public RuleReference(Rule theRule, RuleSetReference theRuleSetReference)
theRule
- the referenced ruletheRuleSetReference
- the rule set, where the rule is definedpublic Language getOverriddenLanguage()
public void setLanguage(Language language)
Rule
setLanguage
in interface Rule
setLanguage
in class AbstractDelegateRule
language
- the languagepublic LanguageVersion getOverriddenMinimumLanguageVersion()
public void setMinimumLanguageVersion(LanguageVersion minimumLanguageVersion)
Rule
setMinimumLanguageVersion
in interface Rule
setMinimumLanguageVersion
in class AbstractDelegateRule
minimumLanguageVersion
- the minimum language versionpublic LanguageVersion getOverriddenMaximumLanguageVersion()
public void setMaximumLanguageVersion(LanguageVersion maximumLanguageVersion)
Rule
setMaximumLanguageVersion
in interface Rule
setMaximumLanguageVersion
in class AbstractDelegateRule
maximumLanguageVersion
- the maximum language versionpublic java.lang.Boolean isOverriddenDeprecated()
public boolean isDeprecated()
Rule
isDeprecated
in interface Rule
isDeprecated
in class AbstractDelegateRule
true
if this rule is deprecatedpublic void setDeprecated(boolean deprecated)
Rule
setDeprecated
in interface Rule
setDeprecated
in class AbstractDelegateRule
deprecated
- whether this rule is deprecatedpublic java.lang.String getOverriddenName()
public java.lang.String getOriginalName()
public void setName(java.lang.String name)
Rule
setName
in interface Rule
setName
in class AbstractDelegateRule
name
- the namepublic java.lang.String getName()
Rule
getName
in interface Rule
getName
in class AbstractDelegateRule
public java.lang.String getOverriddenMessage()
public void setMessage(java.lang.String message)
Rule
setMessage
in interface Rule
setMessage
in class AbstractDelegateRule
message
- the message to show for a violation.public java.lang.String getOverriddenDescription()
public void setDescription(java.lang.String description)
Rule
setDescription
in interface Rule
setDescription
in class AbstractDelegateRule
description
- the descriptionpublic java.util.List<java.lang.String> getOverriddenExamples()
public void addExample(java.lang.String example)
Rule
addExample
in interface Rule
addExample
in class AbstractDelegateRule
example
- a single example to addpublic java.lang.String getOverriddenExternalInfoUrl()
public void setExternalInfoUrl(java.lang.String externalInfoUrl)
Rule
setExternalInfoUrl
in interface Rule
setExternalInfoUrl
in class AbstractDelegateRule
externalInfoUrl
- the URL for external information about this rule.public RulePriority getOverriddenPriority()
public void setPriority(RulePriority priority)
Rule
setPriority
in interface Rule
setPriority
in class AbstractDelegateRule
priority
- the prioritypublic java.util.List<PropertyDescriptor<?>> getOverriddenPropertyDescriptors()
public void definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor) throws java.lang.IllegalArgumentException
PropertySource
definePropertyDescriptor
in interface PropertySource
definePropertyDescriptor
in class AbstractDelegateRule
propertyDescriptor
- The property descriptor.java.lang.IllegalArgumentException
- If there is already a property defined the same name.public java.util.Map<PropertyDescriptor<?>,java.lang.Object> getOverriddenPropertiesByPropertyDescriptor()
public <T> void setProperty(PropertyDescriptor<T> propertyDescriptor, T value)
PropertySource
setProperty
in interface PropertySource
setProperty
in class AbstractDelegateRule
T
- The underlying type of the property descriptor.propertyDescriptor
- The property descriptor.value
- The value to set.public RuleSetReference getRuleSetReference()
public void setRuleSetReference(RuleSetReference ruleSetReference)
public boolean hasDescriptor(PropertyDescriptor<?> descriptor)
PropertySource
hasDescriptor
in interface PropertySource
hasDescriptor
in class AbstractDelegateRule
descriptor
- The PropertyDescriptor for which to check.true
if the descriptor is present, false
otherwise.PropertySource.hasDescriptor(PropertyDescriptor)
public boolean hasOverriddenProperty(PropertyDescriptor<?> descriptor)
public boolean usesDefaultValues()
PropertySource
true
if the properties all have default values, false
otherwise.public void useDefaultValueFor(PropertyDescriptor<?> desc)
PropertySource
desc
- the property to clear outCopyright © 2002–2018 PMD. All rights reserved.