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 |
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, getName, 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
public LanguageVersion getOverriddenMinimumLanguageVersion()
public void setMinimumLanguageVersion(LanguageVersion minimumLanguageVersion)
Rule
setMinimumLanguageVersion
in interface Rule
setMinimumLanguageVersion
in class AbstractDelegateRule
public LanguageVersion getOverriddenMaximumLanguageVersion()
public void setMaximumLanguageVersion(LanguageVersion maximumLanguageVersion)
Rule
setMaximumLanguageVersion
in interface Rule
setMaximumLanguageVersion
in class AbstractDelegateRule
public Boolean isOverriddenDeprecated()
public boolean isDeprecated()
Rule
isDeprecated
in interface Rule
isDeprecated
in class AbstractDelegateRule
public void setDeprecated(boolean deprecated)
Rule
setDeprecated
in interface Rule
setDeprecated
in class AbstractDelegateRule
public String getOverriddenName()
public void setName(String name)
Rule
setName
in interface Rule
setName
in class AbstractDelegateRule
public String getOverriddenMessage()
public void setMessage(String message)
Rule
setMessage
in interface Rule
setMessage
in class AbstractDelegateRule
public String getOverriddenDescription()
public void setDescription(String description)
Rule
setDescription
in interface Rule
setDescription
in class AbstractDelegateRule
public void addExample(String example)
Rule
addExample
in interface Rule
addExample
in class AbstractDelegateRule
public String getOverriddenExternalInfoUrl()
public void setExternalInfoUrl(String externalInfoUrl)
Rule
setExternalInfoUrl
in interface Rule
setExternalInfoUrl
in class AbstractDelegateRule
public RulePriority getOverriddenPriority()
public void setPriority(RulePriority priority)
Rule
setPriority
in interface Rule
setPriority
in class AbstractDelegateRule
public 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
Copyright © 2002-2015 InfoEther. All Rights Reserved.