本文整理汇总了Java中org.sonar.api.profiles.ProfileDefinition类的典型用法代码示例。如果您正苦于以下问题:Java ProfileDefinition类的具体用法?Java ProfileDefinition怎么用?Java ProfileDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProfileDefinition类属于org.sonar.api.profiles包,在下文中一共展示了ProfileDefinition类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadExtensions
import org.sonar.api.profiles.ProfileDefinition; //导入依赖的package包/类
private static void loadExtensions(ComponentContainer container, PluginInfo pluginInfo, Plugin.Context context) {
for (Object extension : context.getExtensions()) {
Boolean isSlPluginOrNull = pluginInfo.isSonarLintSupported();
boolean isExplicitlySonarLintCompatible = isSlPluginOrNull != null && isSlPluginOrNull.booleanValue();
if (isExplicitlySonarLintCompatible) {
// When plugin itself claim to be compatible with SonarLint, only load @SonarLintSide extensions
// filter out non officially supported Sensors
if (!blacklisted(extension) && ExtensionUtils.isSonarLintSide(extension) && (PluginCacheLoader.isWhitelisted(pluginInfo.getKey()) || isNotSensor(extension))) {
container.addExtension(pluginInfo, extension);
}
} else if (!blacklisted(extension) && (ExtensionUtils.isScannerSide(extension) || ExtensionUtils.isType(extension, ProfileDefinition.class))) {
// Here we have whitelisted extensions of whitelisted plugins
container.addExtension(pluginInfo, extension);
} else {
LOG.debug("Extension {} was blacklisted as it is not used by SonarLint", className(extension));
}
}
}
示例2: getExtensions
import org.sonar.api.profiles.ProfileDefinition; //导入依赖的package包/类
@Override
public List getExtensions() {
List extensions = new ArrayList<Object>();
extensions.add(new AbstractLanguage("vbnet") {
@Override
public String[] getFileSuffixes() {
return new String[] {".vb"};
}
});
extensions.add(new ProfileDefinition() {
@Override
public RulesProfile createProfile(ValidationMessages validation) {
RulesProfile profile = RulesProfile.create("Sonar Way", "vbnet");
profile.setDefaultProfile(true);
return profile;
}
});
return extensions;
}
示例3: profilesByLanguage
import org.sonar.api.profiles.ProfileDefinition; //导入依赖的package包/类
private static ListMultimap<String, RulesProfile> profilesByLanguage(ProfileDefinition[] profileDefinitions) {
ListMultimap<String, RulesProfile> byLang = ArrayListMultimap.create();
for (ProfileDefinition definition : profileDefinitions) {
ValidationMessages validation = ValidationMessages.create();
RulesProfile profile = definition.createProfile(validation);
if (profile != null && !validation.hasErrors()) {
byLang.put(StringUtils.lowerCase(profile.getLanguage()), profile);
}
}
return byLang;
}
示例4: StandaloneActiveRulesProvider
import org.sonar.api.profiles.ProfileDefinition; //导入依赖的package包/类
public StandaloneActiveRulesProvider(StandaloneRuleDefinitionsLoader ruleDefsLoader, ProfileDefinition[] profileDefinitions) {
this.ruleDefsLoader = ruleDefsLoader;
this.profileDefinitions = profileDefinitions;
}