[doc] Document the delimiter for multi valued properties
This commit is contained in:
@ -39,6 +39,7 @@ import net.sourceforge.pmd.RuleSetNotFoundException;
|
||||
import net.sourceforge.pmd.lang.Language;
|
||||
import net.sourceforge.pmd.lang.rule.RuleReference;
|
||||
import net.sourceforge.pmd.lang.rule.XPathRule;
|
||||
import net.sourceforge.pmd.properties.MultiValuePropertyDescriptor;
|
||||
import net.sourceforge.pmd.properties.PropertyDescriptor;
|
||||
|
||||
public class RuleDocGenerator {
|
||||
@ -421,8 +422,8 @@ public class RuleDocGenerator {
|
||||
if (!properties.isEmpty()) {
|
||||
lines.add("**This rule has the following properties:**");
|
||||
lines.add("");
|
||||
lines.add("|Name|Default Value|Description|");
|
||||
lines.add("|----|-------------|-----------|");
|
||||
lines.add("|Name|Default Value|Description|Multivalued|");
|
||||
lines.add("|----|-------------|-----------|-----------|");
|
||||
for (PropertyDescriptor<?> propertyDescriptor : properties) {
|
||||
String description = propertyDescriptor.description();
|
||||
if (description != null && description.toLowerCase(Locale.ROOT).startsWith(DEPRECATED_RULE_PROPERTY_MARKER)) {
|
||||
@ -441,9 +442,18 @@ public class RuleDocGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
String multiValued = "no";
|
||||
if (propertyDescriptor.isMultiValue()) {
|
||||
MultiValuePropertyDescriptor<?> multiValuePropertyDescriptor =
|
||||
(MultiValuePropertyDescriptor<?>) propertyDescriptor;
|
||||
multiValued = "yes. Delimiter is '"
|
||||
+ multiValuePropertyDescriptor.multiValueDelimiter() + "'";
|
||||
}
|
||||
|
||||
lines.add("|" + propertyDescriptor.name()
|
||||
+ "|" + defaultValue.replace("|", "\\|")
|
||||
+ "|" + description
|
||||
+ "|" + multiValued.replace("|", "\\|")
|
||||
+ "|");
|
||||
}
|
||||
lines.add("");
|
||||
|
@ -60,11 +60,11 @@ public class JumbledIncrementerRule1 {
|
||||
|
||||
**This rule has the following properties:**
|
||||
|
||||
|Name|Default Value|Description|
|
||||
|----|-------------|-----------|
|
||||
|sampleAdditionalProperty|the value|This is a additional property for tests|
|
||||
|sampleMultiStringProperty|Value1\|Value2|Test property with multiple strings|
|
||||
|sampleDeprecatedProperty|test|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> This is a sample deprecated property for tests|
|
||||
|Name|Default Value|Description|Multivalued|
|
||||
|----|-------------|-----------|-----------|
|
||||
|sampleAdditionalProperty|the value|This is a additional property for tests|no|
|
||||
|sampleMultiStringProperty|Value1\|Value2|Test property with multiple strings|yes. Delimiter is '\|'|
|
||||
|sampleDeprecatedProperty|test|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> This is a sample deprecated property for tests|no|
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
@ -198,11 +198,11 @@ public class JumbledIncrementerRule1 {
|
||||
|
||||
**This rule has the following properties:**
|
||||
|
||||
|Name|Default Value|Description|
|
||||
|----|-------------|-----------|
|
||||
|sampleAdditionalProperty|the value|This is a additional property for tests|
|
||||
|sampleMultiStringProperty|Value1\|Value2|Test property with multiple strings|
|
||||
|sampleDeprecatedProperty|test|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> This is a sample deprecated property for tests|
|
||||
|Name|Default Value|Description|Multivalued|
|
||||
|----|-------------|-----------|-----------|
|
||||
|sampleAdditionalProperty|the value|This is a additional property for tests|no|
|
||||
|sampleMultiStringProperty|Value1\|Value2|Test property with multiple strings|yes. Delimiter is '\|'|
|
||||
|sampleDeprecatedProperty|test|<span style="border-radius: 0.25em; color: #fff; padding: 0.2em 0.6em 0.3em; display: inline; background-color: #d9534f; font-size: 75%;">Deprecated</span> This is a sample deprecated property for tests|no|
|
||||
|
||||
**Use this rule by referencing it:**
|
||||
``` xml
|
||||
|
Reference in New Issue
Block a user