• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JavaCheck类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.sonar.plugins.java.api.JavaCheck的典型用法代码示例。如果您正苦于以下问题:Java JavaCheck类的具体用法?Java JavaCheck怎么用?Java JavaCheck使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JavaCheck类属于org.sonar.plugins.java.api包,在下文中一共展示了JavaCheck类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: loadRule

点赞 3

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
private RulesDefinition.NewRule loadRule(RulesDefinition.NewExtendedRepository repo, Class<? extends JavaCheck> clazz, Rule ruleAnnotation) {
	String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName());
	String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null);
	String description = StringUtils.defaultIfEmpty(getDescriptionFromResources(ruleKey), "No description yet.");

	RulesDefinition.NewRule rule = repo.createRule(ruleKey);
	rule.setName(ruleName).setMarkdownDescription(description);
	rule.setSeverity(ruleAnnotation.priority().name());
	rule.setStatus(RuleStatus.valueOf(ruleAnnotation.status()));
	rule.setTags(ruleAnnotation.tags());

	List<Field> fields = FieldUtils2.getFields(clazz, true);
	for (Field field : fields) {
		loadParameters(rule, field);
	}

	return rule;
}
 

开发者ID:Cognifide,
项目名称:AEM-Rules-for-SonarQube,
代码行数:19,
代码来源:RulesLoader.java

示例2: getJavaChecks

点赞 2

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
public static List<Class<? extends JavaCheck>> getJavaChecks() {
  return ImmutableList.<Class<? extends JavaCheck>>builder()
    .add(SpringControllerRequestMappingEntityRule.class)
    .add(AvoidAnnotationRule.class)
    .add(AvoidBrandInMethodNamesRule.class)
    .add(AvoidMethodDeclarationRule.class)
    .add(AvoidSuperClassRule.class)
    .add(AvoidUnmodifiableListRule.class)
    .add(MyCustomSubscriptionRule.class)
    .add(SecurityAnnotationMandatoryRule.class)
    .build();
}
 

开发者ID:SonarSource,
项目名称:sonar-custom-rules-examples,
代码行数:13,
代码来源:RulesList.java

示例3: checkClasses

点赞 2

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
/**
 * Lists all the main checks provided by the plugin
 */
public static List<Class<? extends JavaCheck>> checkClasses() {
  return RulesList.getJavaChecks();
}
 

开发者ID:SonarSource,
项目名称:sonar-custom-rules-examples,
代码行数:7,
代码来源:MyJavaFileCheckRegistrar.java

示例4: testCheckClasses

点赞 2

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
/**
 * Lists all the test checks provided by the plugin
 */
public static List<Class<? extends JavaCheck>> testCheckClasses() {
  return RulesList.getJavaTestChecks();
}
 

开发者ID:SonarSource,
项目名称:sonar-custom-rules-examples,
代码行数:7,
代码来源:MyJavaFileCheckRegistrar.java

示例5: getJavaTestChecks

点赞 2

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
public static List<Class<? extends JavaCheck>> getJavaTestChecks() {
  return ImmutableList.<Class<? extends JavaCheck>>builder()
    .build();
}
 

开发者ID:SonarSource,
项目名称:sonar-custom-rules-examples,
代码行数:5,
代码来源:RulesList.java

示例6: checkClasses

点赞 2

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
/**
 * Lists all the checks provided by the plugin
 */
public static Class<? extends JavaCheck>[] checkClasses() {
    return AxwayRules.getRuleClasses();
}
 

开发者ID:Axway,
项目名称:sonar-rules,
代码行数:7,
代码来源:AxwayJavaFileScannersFactory.java

示例7: CheckUsageInConstructorVisitor

点赞 2

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
private CheckUsageInConstructorVisitor(JavaCheck javaCheck, JavaFileScannerContext context, final Set<String> methodParams) {
	this.javaCheck = javaCheck;
	this.context = context;
	this.methodParams = methodParams;
}
 

开发者ID:Cognifide,
项目名称:AEM-Rules-for-SonarQube,
代码行数:6,
代码来源:JcrPropertyFieldsInConstructorCheck.java

示例8: load

点赞 2

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
public void load(RulesDefinition.NewExtendedRepository repo, List<Class<? extends JavaCheck>> annotatedClasses) {
	for (Class<? extends JavaCheck> annotatedClass : annotatedClasses) {
		loadRule(repo, annotatedClass);
	}
}
 

开发者ID:Cognifide,
项目名称:AEM-Rules-for-SonarQube,
代码行数:6,
代码来源:RulesLoader.java

示例9: register

点赞 2

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
@Override
public void register(RegistrarContext registrarContext) {
	registrarContext.registerClassesForRepository(REPOSITORY_KEY, CHECK_CLASSES,
		Collections.<Class<? extends JavaCheck>>emptyList());
}
 

开发者ID:Cognifide,
项目名称:AEM-Rules-for-SonarQube,
代码行数:6,
代码来源:CheckListRegistrar.java

示例10: checkClasses

点赞 1

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
/**
 * Returns all {@link JavaCheck} that need to be applied to source code.
 *
 * @return checks to be applied to source code
 */
public static Iterable<Class<? extends JavaCheck>> checkClasses() {
    return checkClasses;
}
 

开发者ID:QualInsight,
项目名称:qualinsight-plugins-sonarqube-smell,
代码行数:9,
代码来源:SmellChecksRegistrar.java

示例11: testCheckClasses

点赞 1

import org.sonar.plugins.java.api.JavaCheck; //导入依赖的package包/类
/**
 * Returns all {@link JavaCheck} that need to be applied to test code.
 *
 * @return checks to be applied to test code
 */
public static Iterable<Class<? extends JavaCheck>> testCheckClasses() {
    return testCheckClasses;
}
 

开发者ID:QualInsight,
项目名称:qualinsight-plugins-sonarqube-smell,
代码行数:9,
代码来源:SmellChecksRegistrar.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)