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

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

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

Rule.<init>介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonarqube

public static Rule create() {
 return new Rule();
}

代码示例来源:origin: SonarSource/sonarqube

/**
 * Create with all required fields
 *
 * @since 2.10
 */
public static Rule create(String repositoryKey, String key) {
 return new Rule().setUniqueKey(repositoryKey, key);
}

代码示例来源: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

@Test
public void default_priority_is_major() {
 Rule rule = Rule.create();
 assertThat(rule.getSeverity()).isEqualTo(RulePriority.MAJOR);
 rule = new Rule("name", "key");
 assertThat(rule.getSeverity()).isEqualTo(RulePriority.MAJOR);
 rule.setSeverity(RulePriority.BLOCKER);
 assertThat(rule.getSeverity()).isEqualTo(RulePriority.BLOCKER);
 rule.setSeverity(null);
 assertThat(rule.getSeverity()).isEqualTo(RulePriority.MAJOR);
}

代码示例来源: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_second_constructor() {
 Rule rule;
 for (String example : getExamplesContainingNewLineCharacter()) {
  rule = new Rule(null, null).setName(example);
  assertThat(rule.getName()).isEqualTo("test");
 }
}

代码示例来源:origin: SonarSource/sonarqube

RuleDto.Format descriptionFormat = rule.getDescriptionFormat();
org.sonar.api.rules.Rule apiRule = new org.sonar.api.rules.Rule();
apiRule
 .setName(rule.getName())

代码示例来源:origin: SonarSource/sonarqube

RuleDto.Format descriptionFormat = ruleDefinition.getDescriptionFormat();
Rule apiRule = new Rule();
apiRule
 .setName(ruleDefinition.getName())

代码示例来源:origin: stackoverflow.com

Fixture.of(Client.class).addTemplate("valid", new Rule(){{
 add("id", random(Long.class, range(1L, 200L)));
 add("name", random("Anderson Parra", "Arthur Hirata"));
 add("nickname", random("nerd", "geek"));
 add("email", "${nickname}@gmail.com");
 add("birthday", instant("18 years ago"));
 add("address", one(Address.class, "valid"));
}});

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

public static Rule create() {
 return new Rule();
}

代码示例来源:origin: stackoverflow.com

class RuleBuilder implements Visitor {
 Set<Rule> rules = new HashSet<Rule>;

 public void handle(Node n) {
  if (n.word != null) {
   return;
  }
  Rule r = new Rule();
  r.left = n.component;
  for (Node child: n.children) {
   r.right.add(child.component);
  }
  rules.add(r);
 }
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api

public static Rule create() {
 return new Rule();
}

代码示例来源:origin: stackoverflow.com

Rule rule = new Rule().maxB(123).minH(45).maxH(122);

代码示例来源:origin: stackoverflow.com

List<Rule> ruleSet = new ArrayList<>();
ruleSet.add(new Rule("Yes", "0 Overcast"));
ruleSet.add(new Rule("No", "0 Rainy", "3 Strong"));
ruleSet.add(new Rule("Yes", "0 Rainy", "3 Weak"));
...

代码示例来源:origin: stackoverflow.com

@Configuration
@ImportResource("classpath:/baseconfig.xml")
public static class RulesConfiguration{
  @Resource List<Rule> commonRules;

  @Bean
  public List<Rule> normalInvRules(){
    List<Rule> rules = new ArrayList<Rule>();
    rules.addAll(commonRules);
    rules.add(new Rule());
    return rules;
  }
}

代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api

/**
 * Create with all required fields
 *
 * @since 2.10
 */
public static Rule create(String repositoryKey, String key) {
 return new Rule().setUniqueKey(repositoryKey, key);
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api

/**
 * Create with all required fields
 *
 * @since 2.10
 */
public static Rule create(String repositoryKey, String key) {
 return new Rule().setUniqueKey(repositoryKey, key);
}

代码示例来源: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: stackoverflow.com

Rule authorizationRule = new Rule();
authorizationRule.setPattern(DocumentHelper.createPattern("//authorize"));

final Stylesheet stylesheet = new Stylesheet();                                 
authorizationRule.setAction(new Action(){
  public void run(Node node) throws Exception {
    stylesheet.applyTemplates(node);
  }
 });

stylesheet.addRule(authorizationRule);
stylesheet.run(document);

相关文章