本文整理了Java中net.sourceforge.pmd.Rule.getDescription
方法的一些代码示例,展示了Rule.getDescription
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.getDescription
方法的具体详情如下:
包路径:net.sourceforge.pmd.Rule
类名称:Rule
方法名:getDescription
[英]Get the description of this Rule.
[中]获取此规则的描述。
代码示例来源:origin: pmd/pmd
@Override
public String getDescription() {
return rule.getDescription();
}
代码示例来源:origin: pmd/pmd
/**
* Shortens and escapes (for markdown) some special characters. Otherwise the shortened text
* could contain some unfinished sequences.
* @param rule
* @return
*/
private static String getShortRuleDescription(Rule rule) {
return StringEscapeUtils.escapeHtml4(
StringUtils.abbreviate(
StringUtils.stripToEmpty(
rule.getDescription()
.replaceAll("\n|\r", "")
.replaceAll("\\|", "\\\\|")
.replaceAll("`", "'")
.replaceAll("\\*", "")),
100));
}
代码示例来源:origin: pmd/pmd
+ Arrays.toString(getCategories()).replaceAll("[\\[\\]]", "") + "\\n\\n"
+ "[Remediation Points](https://github.com/codeclimate/spec/blob/master/SPEC.md#remediation-points): "
+ getRemediationPoints() + "\\n\\n" + cleaned(rule.getDescription());
代码示例来源:origin: pmd/pmd
lines.addAll(EscapeUtils.escapeLines(toLines(stripIndentation(rule.getDescription()))));
lines.add("");
代码示例来源:origin: pmd/pmd
assertEquals(message + ", Rule description " + rule1.getName(), rule1.getDescription(),
rule2.getDescription());
assertEquals(message + ", Rule message", rule1.getMessage(), rule2.getMessage());
assertEquals(message + ", Rule external info url", rule1.getExternalInfoUrl(), rule2.getExternalInfoUrl());
代码示例来源:origin: pmd/pmd
rule.getName(), rule.getSince(), null, rule.getMessage(), rule.getExternalInfoUrl(),
rule.getRuleClass(), rule.isDfa(), rule.isTypeResolution(), rule.isMultifile(),
rule.getDescription(),
rule.getPriority(), rule.getPropertyDescriptors(), rule.getPropertiesByPropertyDescriptor(),
rule.getExamples());
代码示例来源:origin: net.sourceforge.pmd/pmd-core
@Override
public String getDescription() {
return rule.getDescription();
}
代码示例来源:origin: org.jvnet.hudson.plugins/pmd
/**
* Creates the message string to be shown for the specified rule.
*
* @param rule
* the rule
* @return the message string to be shown for the specified rule
*/
private String createMessage(final Rule rule) {
List<String> examples = rule.getExamples();
if (!examples.isEmpty()) {
return rule.getDescription() + "<pre>" + examples.get(0) + "</pre>";
}
return rule.getDescription();
}
}
代码示例来源:origin: jenkinsci/pmd-plugin
/**
* Creates the message string to be shown for the specified rule.
*
* @param rule
* the rule
* @return the message string to be shown for the specified rule
*/
private String createMessage(final Rule rule) {
List<String> examples = rule.getExamples();
if (!examples.isEmpty()) {
return rule.getDescription() + "<pre>" + examples.get(0) + "</pre>";
}
return rule.getDescription();
}
}
代码示例来源:origin: org.hudsonci.plugins/pmd
/**
* Creates the message string to be shown for the specified rule.
*
* @param rule
* the rule
* @return the message string to be shown for the specified rule
*/
private String createMessage(final Rule rule) {
List<String> examples = rule.getExamples();
if (!examples.isEmpty()) {
return rule.getDescription() + "<pre>" + examples.get(0) + "</pre>";
}
return rule.getDescription();
}
}
代码示例来源:origin: jenkinsci/warnings-ng-plugin
/**
* Creates the message string to be shown for the specified rule.
*
* @param rule
* the rule
*
* @return the message string to be shown for the specified rule
*/
private String createMessage(final Rule rule) {
StringBuilder message = new StringBuilder(rule.getDescription());
List<String> examples = rule.getExamples();
if (!examples.isEmpty()) {
message.append(pre().with(code(examples.get(0))).renderFormatted());
}
if (StringUtils.isNotBlank(rule.getExternalInfoUrl())) {
message.append(a().withHref(rule.getExternalInfoUrl()).withText("See PMD documentation.").renderFormatted());
}
return message.toString();
}
}
代码示例来源:origin: net.sourceforge.pmd/pmd-core
+ Arrays.toString(getCategories()).replaceAll("[\\[\\]]", "") + "\\n\\n"
+ "[Remediation Points](https://github.com/codeclimate/spec/blob/master/SPEC.md#remediation-points): "
+ getRemediationPoints() + "\\n\\n" + cleaned(rule.getDescription());
代码示例来源:origin: net.sourceforge.pmd/pmd-test
assertEquals(message + ", Rule description " + rule1.getName(), rule1.getDescription(),
rule2.getDescription());
assertEquals(message + ", Rule message", rule1.getMessage(), rule2.getMessage());
assertEquals(message + ", Rule external info url", rule1.getExternalInfoUrl(), rule2.getExternalInfoUrl());
代码示例来源:origin: net.sourceforge.pmd/pmd-core
rule.getName(), rule.getSince(), null, rule.getMessage(), rule.getExternalInfoUrl(),
rule.getRuleClass(), rule.isDfa(), rule.isTypeResolution(), rule.isMultifile(),
rule.getDescription(),
rule.getPriority(), rule.getPropertyDescriptors(), rule.getPropertiesByPropertyDescriptor(),
rule.getExamples());
内容来源于网络,如有侵权,请联系作者删除!