本文整理了Java中org.sonar.api.rules.Rule.setCardinality
方法的一些代码示例,展示了Rule.setCardinality
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.setCardinality
方法的具体详情如下:
包路径:org.sonar.api.rules.Rule
类名称:Rule
方法名:setCardinality
暂无
代码示例来源:origin: SonarSource/sonarqube
rule.setCardinality(Cardinality.valueOf(StringUtils.trim(cursor.collectDescendantText(false))));
代码示例来源:origin: SonarSource/sonarqube
private static Rule toRule(String repositoryKey, Class clazz, org.sonar.check.Rule ruleAnnotation) {
String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
Rule rule = Rule.create(repositoryKey, ruleKey, ruleName);
rule.setDescription(description);
rule.setSeverity(RulePriority.fromCheckPriority(ruleAnnotation.priority()));
rule.setCardinality(ruleAnnotation.cardinality());
rule.setStatus(ruleAnnotation.status());
rule.setTags(ruleAnnotation.tags());
List<Field> fields = FieldUtils2.getFields(clazz, true);
for (Field field : fields) {
addRuleProperty(rule, field);
}
return rule;
}
代码示例来源:origin: org.codehaus.sonar/sonar-deprecated
rule.setCardinality(Cardinality.valueOf(StringUtils.trim(cursor.collectDescendantText(false))));
代码示例来源:origin: org.codehaus.sonar-plugins/sonar-web-plugin
public static Rule createRule(String repositoryKey, Class clazz, org.sonar.check.Rule ruleAnnotation, @Nullable RuleTags ruleTagsAnnotation) {
String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
Rule rule = Rule.create(repositoryKey, ruleKey, ruleName);
rule.setDescription(description);
rule.setSeverity(RulePriority.fromCheckPriority(ruleAnnotation.priority()));
rule.setCardinality(ruleAnnotation.cardinality());
setTags(rule, ruleTagsAnnotation);
Field[] fields = clazz.getDeclaredFields();
if (fields != null) {
for (Field field : fields) {
addRuleProperty(rule, field);
}
}
return rule;
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api
private static Rule toRule(String repositoryKey, Class clazz, org.sonar.check.Rule ruleAnnotation) {
String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
Rule rule = Rule.create(repositoryKey, ruleKey, ruleName);
rule.setDescription(description);
rule.setSeverity(RulePriority.fromCheckPriority(ruleAnnotation.priority()));
rule.setCardinality(ruleAnnotation.cardinality());
rule.setStatus(ruleAnnotation.status());
rule.setTags(ruleAnnotation.tags());
List<Field> fields = FieldUtils2.getFields(clazz, true);
for (Field field : fields) {
addRuleProperty(rule, field);
}
return rule;
}
代码示例来源:origin: org.codehaus.sonar/sonar-deprecated
private Rule toRule(String repositoryKey, Class clazz, org.sonar.check.Rule ruleAnnotation) {
String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null);
Rule rule = Rule.create(repositoryKey, ruleKey, ruleName);
rule.setDescription(description);
rule.setSeverity(RulePriority.fromCheckPriority(ruleAnnotation.priority()));
rule.setCardinality(ruleAnnotation.cardinality());
rule.setStatus(ruleAnnotation.status());
rule.setTags(ruleAnnotation.tags());
List<Field> fields = FieldUtils2.getFields(clazz, true);
for (Field field : fields) {
addRuleProperty(rule, field);
}
return rule;
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api
rule.setCardinality(Cardinality.valueOf(StringUtils.trim(cursor.collectDescendantText(false))));
内容来源于网络,如有侵权,请联系作者删除!