本文整理了Java中org.sonar.api.rules.Rule.setTemplate
方法的一些代码示例,展示了Rule.setTemplate
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.setTemplate
方法的具体详情如下:
包路径:org.sonar.api.rules.Rule
类名称:Rule
方法名:setTemplate
暂无
代码示例来源:origin: SonarSource/sonarqube
/**
* @deprecated since 4.4, use {@link #setTemplate(Rule)}}
*/
@Deprecated
public Rule setParent(Rule parent) {
return setTemplate(parent);
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api
/**
* @deprecated since 4.4, use {@link #setTemplate(Rule)}}
*/
@Deprecated
public Rule setParent(Rule parent) {
return setTemplate(parent);
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-batch
private static RulesProfile select(QProfile qProfile, ActiveRules activeRules) {
RulesProfile deprecatedProfile = new RulesProfile();
// TODO deprecatedProfile.setVersion(qProfile.version());
deprecatedProfile.setName(qProfile.getName());
deprecatedProfile.setLanguage(qProfile.getLanguage());
for (org.sonar.api.batch.rule.ActiveRule activeRule : activeRules.findByLanguage(qProfile.getLanguage())) {
Rule rule = Rule.create(activeRule.ruleKey().repository(), activeRule.ruleKey().rule());
rule.setConfigKey(activeRule.internalKey());
// SONAR-6706
if (activeRule.templateRuleKey() != null) {
rule.setTemplate(Rule.create(activeRule.ruleKey().repository(), activeRule.templateRuleKey()));
}
ActiveRule deprecatedActiveRule = deprecatedProfile.activateRule(rule,
RulePriority.valueOf(activeRule.severity()));
for (Map.Entry<String, String> param : activeRule.params().entrySet()) {
rule.createParameter(param.getKey());
deprecatedActiveRule.setParameter(param.getKey(), param.getValue());
}
}
return deprecatedProfile;
}
内容来源于网络,如有侵权,请联系作者删除!