本文整理了Java中org.sonar.api.rules.Rule.setName
方法的一些代码示例,展示了Rule.setName
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.setName
方法的具体详情如下:
包路径:org.sonar.api.rules.Rule
类名称:Rule
方法名:setName
[英]Sets the rule name
[中]设置规则名称
代码示例来源:origin: SonarSource/sonarqube
/**
* Create with all required fields
*/
public static Rule create(String repositoryKey, String key, String name) {
return new Rule().setUniqueKey(repositoryKey, key).setName(name);
}
代码示例来源:origin: SonarSource/sonarqube
rule.setName(StringUtils.trim(cursor.collectDescendantText(false)));
代码示例来源:origin: SonarSource/sonarqube
@Test
public void should_remove_new_line_characters_in_name_with_first_constructor() {
Rule rule;
for (String example : getExamplesContainingNewLineCharacter()) {
rule = new Rule(null, null).setName(example);
assertThat(rule.getName()).isEqualTo("test");
}
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void should_remove_new_line_characters_in_name_with_setter() {
Rule rule = Rule.create();
for (String example : getExamplesContainingNewLineCharacter()) {
rule.setName(example);
assertThat(rule.getName()).isEqualTo("test");
}
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void should_remove_new_line_characters_in_name_with_second_constructor() {
Rule rule;
for (String example : getExamplesContainingNewLineCharacter()) {
rule = new Rule(null, null).setName(example);
assertThat(rule.getName()).isEqualTo("test");
}
}
代码示例来源:origin: SonarSource/sonarqube
.setName(rule.getName())
.setLanguage(rule.getLanguage())
.setKey(rule.getRuleKey())
代码示例来源:origin: SonarSource/sonarqube
.setName(ruleDefinition.getName())
.setLanguage(ruleDefinition.getLanguage())
.setKey(ruleDefinition.getRuleKey())
代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api
/**
* Create with all required fields
*/
public static Rule create(String repositoryKey, String key, String name) {
return new Rule().setUniqueKey(repositoryKey, key).setName(name);
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api
/**
* Create with all required fields
*/
public static Rule create(String repositoryKey, String key, String name) {
return new Rule().setUniqueKey(repositoryKey, key).setName(name);
}
代码示例来源:origin: octo-technology/sonar-objective-c
rule.setName(previousLine);
rule.setKey(previousLine);
} else if (line.matches("Summary:.*")) {
代码示例来源:origin: org.codehaus.sonar/sonar-batch
@Override
public Rule findByKey(RuleKey key) {
DefaultActiveRule ar = (DefaultActiveRule) activeRules.find(key);
return ar == null ? null : Rule.create(key.repository(), key.rule()).setName(ar.name());
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-batch
@CheckForNull
private static Rule toRule(@Nullable org.sonar.api.batch.rule.Rule ar) {
return ar == null ? null : Rule.create(ar.key().repository(), ar.key().rule()).setName(ar.name()).setConfigKey(ar.internalKey());
}
代码示例来源:origin: org.codehaus.sonar/sonar-deprecated
rule.setName(StringUtils.trim(cursor.collectDescendantText(false)));
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
.setName(rule.getName())
.setLanguage(rule.getLanguage())
.setKey(rule.getRuleKey())
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
.setName(ruleDefinition.getName())
.setLanguage(ruleDefinition.getLanguage())
.setKey(ruleDefinition.getRuleKey())
代码示例来源:origin: SonarSource/sonarlint-core
private static Rule toRuleNotNull(RulesDefinition.Rule ruleDef) {
Rule rule = Rule.create(ruleDef.repository().key(), ruleDef.key())
.setName(ruleDef.name())
.setSeverity(RulePriority.valueOf(ruleDef.severity()))
.setLanguage(ruleDef.repository().language())
.setIsTemplate(ruleDef.template())
.setConfigKey(ruleDef.internalKey());
for (Param param : ruleDef.params()) {
rule.createParameter(param.key()).setDefaultValue(param.defaultValue()).setDescription(param.description());
}
return rule;
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api
rule.setName(StringUtils.trim(cursor.collectDescendantText(false)));
内容来源于网络,如有侵权,请联系作者删除!