public class RuleReference extends AbstractDelegateRule
VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR
Constructor and Description |
---|
RuleReference() |
RuleReference(Rule theRule,
RuleSetReference theRuleSetReference) |
Modifier and Type | Method and Description |
---|---|
void |
addExample(String example)
Add a single example for this Rule.
|
void |
definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor)
Define a new property via a PropertyDescriptor.
|
String |
getName()
Get the name of this Rule.
|
String |
getOriginalName() |
String |
getOverriddenDescription() |
List<String> |
getOverriddenExamples() |
String |
getOverriddenExternalInfoUrl() |
Language |
getOverriddenLanguage() |
LanguageVersion |
getOverriddenMaximumLanguageVersion() |
String |
getOverriddenMessage() |
LanguageVersion |
getOverriddenMinimumLanguageVersion() |
String |
getOverriddenName() |
RulePriority |
getOverriddenPriority() |
Map<PropertyDescriptor<?>,Object> |
getOverriddenPropertiesByPropertyDescriptor() |
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.
|
Boolean |
isOverriddenDeprecated() |
void |
setDeprecated(boolean deprecated)
Sets whether this Rule is deprecated.
|
void |
setDescription(String description)
Set the description of this Rule.
|
void |
setExternalInfoUrl(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(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(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, setRule, setRuleClass, setRuleSetName, setSince, setUsesDFA, setUsesTypeResolution, start, usesDFA, usesRuleChain, usesTypeResolution
public RuleReference()
public RuleReference(Rule theRule, RuleSetReference theRuleSetReference)
public 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 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 String getOverriddenName()
public String getOriginalName()
public void setName(String name)
Rule
setName
in interface Rule
setName
in class AbstractDelegateRule
name
- the namepublic String getName()
Rule
getName
in interface Rule
getName
in class AbstractDelegateRule
public String getOverriddenMessage()
public void setMessage(String message)
Rule
setMessage
in interface Rule
setMessage
in class AbstractDelegateRule
message
- the message to show for a violation.public String getOverriddenDescription()
public void setDescription(String description)
Rule
setDescription
in interface Rule
setDescription
in class AbstractDelegateRule
description
- the descriptionpublic void addExample(String example)
Rule
addExample
in interface Rule
addExample
in class AbstractDelegateRule
example
- a single example to addpublic String getOverriddenExternalInfoUrl()
public void setExternalInfoUrl(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 List<PropertyDescriptor<?>> getOverriddenPropertyDescriptors()
public void definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor) throws IllegalArgumentException
PropertySource
definePropertyDescriptor
in interface PropertySource
definePropertyDescriptor
in class AbstractDelegateRule
propertyDescriptor
- The property descriptor.IllegalArgumentException
- If there is already a property defined
the same name.public Map<PropertyDescriptor<?>,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-2017 PMD. All Rights Reserved.