org.sonar.api.rules.Rule.setName()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中org.sonar.api.rules.Rule.setName方法的一些代码示例,展示了Rule.setName的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.setName方法的具体详情如下:
包路径:org.sonar.api.rules.Rule
类名称:Rule
方法名:setName

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)));

相关文章