当前位置: 首页>>代码示例>>Java>>正文


Java PropertyDefinition类代码示例

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


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

示例1: define

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
@Override
public void define(Context context) {
  
  context.addExtensions(

    PropertyDefinition.builder(FILE_SUFFIXES_KEY)
      .name("File Suffixes")
      .description("Comma-separated list of suffixes of 1C 7.7 Enterprise files to analyze.")
      .subCategory(GENERAL)
      .onQualifiers(Qualifiers.PROJECT)
      .defaultValue("1s")
      .build(),

    OneC.class,
    OneCSensor.class,
    OneCQualityProfile.class
    
    );
 
}
 
开发者ID:antowski,项目名称:sonar-onec,代码行数:21,代码来源:OneCPlugin.java

示例2: definitions

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
/**
 * Property definitions.
 *
 * @return property definitions
 */
public static List<PropertyDefinition> definitions() {
	final PropertyDefinition issueMode = PropertyDefinition.builder(ISSUE_MODE_KEY).name("Issue mode")
			.description(
					"How to report issues (only on packages, on packages and fallback to classes, only on classes)")
			.category(CATEGORY).type(PropertyType.SINGLE_SELECT_LIST)
			.options(ISSUE_MODE_PACKAGE, ISSUE_MODE_FALLBACK, ISSUE_MODE_CLASS).defaultValue(ISSUE_MODE_FALLBACK)
			.index(100).onQualifiers(Qualifiers.PROJECT).build();

	final PropertyDefinition classMode = PropertyDefinition.builder(CLASS_MODE_KEY).name("Class mode")
			.description(
					"How to report issues when using class modes (on all classes, on the first class in the package)")
			.category(CATEGORY).type(PropertyType.SINGLE_SELECT_LIST).options(CLASS_MODE_ALL, CLASS_MODE_FIRST)
			.defaultValue(CLASS_MODE_ALL).index(200).onQualifiers(Qualifiers.PROJECT).build();

	return Arrays.asList(issueMode, classMode);
}
 
开发者ID:willemsrb,项目名称:sonar-packageanalyzer-plugin,代码行数:22,代码来源:PackageAnalyzerProperties.java

示例3: getProperties

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
/**
 * Plugin properties extensions
 */
public static List<PropertyDefinition> getProperties() {
	return asList(PropertyDefinition.builder(REPORT_SUBDIR_KEY)
			.defaultValue(REPORT_SUBDIR_DEFAULT_VALUE).category(FramaCLanguage.NAME)
			.name("Report subdirectory").description("Name of Frama-C output report subdirectory.")
			// .onQualifiers(Qualifiers.PROJECT)
			.build(),
			PropertyDefinition.builder(REPORT_OUT_EXT_KEY)
			.defaultValue(REPORT_OUT_EXT_DEFAULT_VALUE).category(FramaCLanguage.NAME)
			.name("Report file Suffixes").description("The report file have the same name as source file followed by this extension name.")
			// .onQualifiers(Qualifiers.PROJECT)
			.build(),
			PropertyDefinition.builder(EXPECTED_REPORT_INPUT_FILE_TYPES_KEY)
			.defaultValue(EXPECTED_REPORT_INPUT_FILE_TYPES_DEFAULT_VALUE).category(FramaCLanguage.NAME)
			.name("File Suffixes").description("Comma-separated list of suffixes for files to analyze.")
			// .onQualifiers(Qualifiers.PROJECT)
			.build());
}
 
开发者ID:lequal,项目名称:sonar-frama-c-plugin,代码行数:21,代码来源:FramaCLanguageProperties.java

示例4: test

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
@Test
public void test() {		
	List<PropertyDefinition> actual = FramaCLanguageProperties.getProperties();
	assertEquals(3, actual.size());
	PropertyDefinition reportSubDirectory = actual.get(0);
	assertEquals(FramaCLanguage.NAME, reportSubDirectory.category());
	assertEquals(FramaCLanguageProperties.REPORT_SUBDIR_DEFAULT_VALUE, reportSubDirectory.defaultValue());
	assertEquals(FramaCLanguageProperties.REPORT_SUBDIR_KEY, reportSubDirectory.key());
	PropertyDefinition reportExtensions = actual.get(1);
	assertEquals(FramaCLanguage.NAME, reportExtensions.category());
	assertEquals(FramaCLanguageProperties.REPORT_OUT_EXT_DEFAULT_VALUE, reportExtensions.defaultValue());
	assertEquals(FramaCLanguageProperties.REPORT_OUT_EXT_KEY, reportExtensions.key());
	PropertyDefinition reportInputFileType = actual.get(2);
	assertEquals(FramaCLanguage.NAME, reportInputFileType.category());
	assertEquals(FramaCLanguageProperties.EXPECTED_REPORT_INPUT_FILE_TYPES_DEFAULT_VALUE, reportInputFileType.defaultValue());
	assertEquals(FramaCLanguageProperties.EXPECTED_REPORT_INPUT_FILE_TYPES_KEY, reportInputFileType.key());
}
 
开发者ID:lequal,项目名称:sonar-frama-c-plugin,代码行数:18,代码来源:FramaCLanguagePropertiesTest.java

示例5: define

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
@Override
public void define(Context context) {
	context.addExtensions(
			VersiondebtSensor.class,
			VersiondebtMetrics.class,
			VersiondebtDashboardWidget.class,
			PropertyDefinition.builder(VERSIONDEBT_REPORT_PATH)
					.category(CoreProperties.CATEGORY_JAVA)
					.subCategory("Versiondebt")
					.name("Report path")
					.description("Path (absolute or relative) to versiondebt xml file.")
					.defaultValue("target/versiondebt.xml")
					.onQualifiers(Qualifiers.PROJECT)
					.build()
	);
}
 
开发者ID:portofrotterdam,项目名称:versiondebt-plugin,代码行数:17,代码来源:VersiondebtPlugin.java

示例6: definitions

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
static List<PropertyDefinition> definitions() {
    return Arrays.asList(PropertyDefinition.builder(GITLAB_AUTH_ENABLED).name("Enabled").description("Enable Gitlab users to login. Value is ignored if client ID and secret are not defined.")
                    .category(CATEGORY).subCategory(SUBCATEGORY).type(BOOLEAN).defaultValue(valueOf(false)).index(1).build(),
            PropertyDefinition.builder(GITLAB_AUTH_URL).name("GitLab url").description("URL to access GitLab.").category(CATEGORY).subCategory(SUBCATEGORY).defaultValue("https://gitlab.com")
                    .index(2).build(),
            PropertyDefinition.builder(GITLAB_AUTH_APPLICATIONID).name("Application ID").description("Application ID provided by GitLab when registering the application.").category(CATEGORY)
                    .subCategory(SUBCATEGORY).index(3).build(),
            PropertyDefinition.builder(GITLAB_AUTH_SECRET).name("Secret").description("Secret provided by GitLab when registering the application.").category(CATEGORY).subCategory(SUBCATEGORY)
                    .type(PropertyType.PASSWORD).index(4).build(), PropertyDefinition.builder(GITLAB_AUTH_ALLOWUSERSTOSIGNUP).name("Allow users to sign-up")
                    .description("Allow new users to authenticate. When set to 'false', only existing users will be able to authenticate to the server.").category(CATEGORY)
                    .subCategory(SUBCATEGORY).type(BOOLEAN).defaultValue(valueOf(true)).index(5).build(),
            PropertyDefinition.builder(GITLAB_AUTH_SCOPE).name("Gitlab access scope")
                    .description("Scope provided by GitLab when access user info.").category(CATEGORY)
                    .subCategory(SUBCATEGORY).type(SINGLE_SELECT_LIST).options(NONE_SCOPE, READ_USER_SCOPE, API_SCOPE).defaultValue(READ_USER_SCOPE).index(6).build(),
            PropertyDefinition.builder(GITLAB_AUTH_GROUPS).name("Default groups").description("Set default groups for user").category(CATEGORY)
                    .subCategory(SUBCATEGORY).index(7).build(),
            PropertyDefinition.builder(GITLAB_AUTH_SYNC_USER_GROUPS).name("Synchronize user groups").description("Synchronize GitLab and Sonar user groups").category(CATEGORY).subCategory(SUBCATEGORY)
                    .type(PropertyType.BOOLEAN).defaultValue(valueOf(false)).index(8).build(),
            PropertyDefinition.builder(GITLAB_AUTH_API_VERSION).name("Set GitLab API version").description("GitLab API version").category(CATEGORY).subCategory(SUBCATEGORY)
                    .type(PropertyType.SINGLE_SELECT_LIST).options(V3_API_VERSION, V4_API_VERSION).defaultValue(V4_API_VERSION).index(9).build(),
            PropertyDefinition.builder(GITLAB_AUTH_USER_EXCEPTIONS).name("User exceptions").description("Comma separated list of usernames to keep intact").category(CATEGORY).subCategory(SUBCATEGORY)
                    .type(PropertyType.STRING).defaultValue("").index(10).build()
    );
}
 
开发者ID:gabrie-allaigre,项目名称:sonar-auth-gitlab-plugin,代码行数:25,代码来源:GitLabAuthPlugin.java

示例7: prepare

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
@Before
public void prepare() throws Exception {
  pullRequestFacade = mock(PullRequestFacade.class);
  Settings settings = new Settings(new PropertyDefinitions(PropertyDefinition.builder(CoreProperties.SERVER_BASE_URL)
    .name("Server base URL")
    .description("HTTP URL of this SonarQube server, such as <i>http://yourhost.yourdomain/sonar</i>. This value is used i.e. to create links in emails.")
    .category(CoreProperties.CATEGORY_GENERAL)
    .defaultValue(CoreProperties.SERVER_BASE_URL_DEFAULT_VALUE)
    .build()));
  GitHubPluginConfiguration config = new GitHubPluginConfiguration(settings, new System2());
  context = mock(PostJobContext.class);

  settings.setProperty("sonar.host.url", "http://192.168.0.1");
  settings.setProperty(CoreProperties.SERVER_BASE_URL, "http://myserver");
  pullRequestIssuePostJob = new PullRequestIssuePostJob(config, pullRequestFacade, new MarkDownUtils(settings));
}
 
开发者ID:SonarSource,项目名称:sonar-github,代码行数:17,代码来源:PullRequestIssuePostJobTest.java

示例8: getExtensions

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
@Override
public List getExtensions() {
  return ImmutableList.of(
    PropertyDefinition.builder(FILE_SUFFIXES_KEY)
      .name("File Suffixes")
      .description("Comma-separated list of suffixes of Puppet files to analyze.")
      .category("Puppet")
      .onQualifiers(Qualifiers.PROJECT)
      .defaultValue("pp")
      .build(),

    Puppet.class,
    PuppetCpdMapping.class,
    PuppetProfile.class,
    PuppetSquidSensor.class,
    PuppetRuleRepository.class,
    PuppetCommonRulesEngine.class
    );
}
 
开发者ID:iwarapter,项目名称:sonar-puppet,代码行数:20,代码来源:PuppetPlugin.java

示例9: getExtensions

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public List getExtensions() {
    List extensionList = new ArrayList();
    extensionList.add(KarmaJunitReporterJsTestDriverSensor.class);

    //Add support for parameters
    extensionList.add(PropertyDefinition.builder(REPORTS_PATH)
          .defaultValue(REPORTS_PATH_DEFAULT_VALUE)
          .name("JSTestDriver output folder")
          .description("Folder where JsTestDriver unit test reports are located.")
          .onQualifiers(Qualifiers.MODULE, Qualifiers.PROJECT)
          .subCategory(TEST_AND_COVERAGE)
          .build());

    return extensionList;
}
 
开发者ID:acwatson,项目名称:sonar-karma-test-report-plugin,代码行数:18,代码来源:KarmaJunitReportPlugin.java

示例10: define

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
@Override
public void define(Context context) {
  context.addExtensions(
    Lua.class,

    LuaSquidSensor.class,
    CoberturaSensor.class,

    LuaRulesDefinition.class,
    LuaProfile.class,

    PropertyDefinition.builder(FILE_SUFFIXES_KEY)
      .defaultValue(Lua.DEFAULT_FILE_SUFFIXES)
      .name("File suffixes")
      .description("Comma-separated list of suffixes for files to analyze. To not filter, leave the list empty.")
      .onQualifiers(Qualifiers.MODULE, Qualifiers.PROJECT)
      .build(),

    PropertyDefinition.builder(COBERTURA_REPORT_PATH)
      .name("Cobertura xml report path")
      .description("Path to the Cobertura coverage report file. The path may be either absolute or relative to the project base directory.")
      .onQualifiers(Qualifiers.MODULE, Qualifiers.PROJECT)
      .build()
  );
}
 
开发者ID:SonarQubeCommunity,项目名称:sonar-lua,代码行数:26,代码来源:LuaPlugin.java

示例11: define

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
public void define(final Context context) {
	context.addExtension(PropertyDefinition.builder(Constants.SKIP_TOKENIZER).name("Skip tokenizer")
			.description("Flag whether to skip tokenizer").defaultValue("false").type(PropertyType.BOOLEAN)
			.build());

	context.addExtension(PropertyDefinition.builder(Constants.FILE_SUFFIXES).name("Suffixes to analyze")
			.description("Suffixes supported by the plugin").defaultValue(".ps1,.psm1,.psd1")
			.type(PropertyType.STRING).build());

	context.addExtensions(PowershellLanguage.class, PowershellQualityProfile.class);
	context.addExtensions(ScriptAnalyzerRulesDefinition.class, ScriptAnalyzerSensor.class);
	context.addExtension(TokenizerSensor.class);
}
 
开发者ID:gretard,项目名称:sonar-ps-plugin,代码行数:14,代码来源:PowershellPlugin.java

示例12: getExtensions

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public List getExtensions() {
    return Arrays
            .asList(PropertyDefinition.builder(CheckstyleConstants.CHECKER_FILTERS_KEY)
                            .defaultValue(CheckstyleConstants.CHECKER_FILTERS_DEFAULT_VALUE)
                            .category(CoreProperties.CATEGORY_JAVA)
                            .subCategory(CHECKSTYLE_SUB_CATEGORY_NAME)
                            .name("Checker Filters")
                            .description(CHECKER_FILTERS_DESCRIPTION)
                            .type(PropertyType.TEXT)
                            .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE).build(),
                    PropertyDefinition.builder(CheckstyleConstants.TREEWALKER_FILTERS_KEY)
                            .defaultValue(CheckstyleConstants.TREEWALKER_FILTERS_DEFAULT_VALUE)
                            .category(CoreProperties.CATEGORY_JAVA)
                            .subCategory(CHECKSTYLE_SUB_CATEGORY_NAME)
                            .name("Treewalker Filters")
                            .description(TREEWALKER_FILTERS_DESCRIPTION)
                            .type(PropertyType.TEXT)
                            .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE).build(),
                    PropertyDefinition.builder(CheckstyleConfiguration.PROPERTY_GENERATE_XML)
                            .defaultValue("false").category(CoreProperties.CATEGORY_JAVA)
                            .subCategory(CHECKSTYLE_SUB_CATEGORY_NAME)
                            .name("Generate XML Report").type(PropertyType.BOOLEAN).hidden()
                            .build(),

                    CheckstyleSensor.class, CheckstyleConfiguration.class,
                    CheckstyleExecutor.class, CheckstyleAuditListener.class,
                    CheckstyleProfileExporter.class, CheckstyleProfileImporter.class,
                    CheckstyleRulesDefinition.class);
}
 
开发者ID:checkstyle,项目名称:sonar-checkstyle,代码行数:32,代码来源:CheckstylePlugin.java

示例13: definitions

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
/**
 * Property definitions.
 *
 * @return property definitions
 */
public static List<PropertyDefinition> definitions() {
    return Arrays.asList(PropertyDefinition.builder(WEIGTHS_KEY).name("Issue weights")
            .description("Relative weiths of issues based on severity (blocker,critical,major,minor,info)")
            .category(CATEGORY).defaultValue("10,5,3,1,0").index(100).onQualifiers(Qualifiers.PROJECT).build(),
            PropertyDefinition.builder(RATINGS_KEY).name("Rating")
                    .description(
                            "Rating (ranging from A (very good) to E (very bad)). This setting define the values for A through D with E being below the last value.")
                    .category(CATEGORY).defaultValue("97,92,85,75").index(200).onQualifiers(Qualifiers.PROJECT)
                    .build());
}
 
开发者ID:willemsrb,项目名称:sonar-rci-plugin,代码行数:16,代码来源:RciProperties.java

示例14: getExtensions

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
@Override
public List<Object> getExtensions() {
  return ImmutableList.of(
    FlowLanguage.class,
    
    FlowProfile.class,
 
    FlowSquidSensor.class,
    
    FlowRulesDefinition.class,
    
    PropertyDefinition.builder(FILE_SUFFIXES_KEY)
      .defaultValue(FILE_SUFFIXES_DEFVALUE)
      .name("File Suffixes")
      .description("Comma-separated list of suffixes for files to analyze.")
      .onQualifiers(Qualifiers.PROJECT)
      .build(),
      
    PropertyDefinition.builder(IGNORE_TOPLEVEL_KEY)
      .defaultValue(IGNORE_TOPLEVEL_DEFVALUE)
      .name("Ignore top-level services")
      .description("Ignore top-level service checks")
      .onQualifiers(Qualifiers.PROJECT)
      .build(),

    PropertyDefinition.builder(FAIL_ON_SCANERROR)
      .defaultValue(FAIL_ON_SCANERROR_DEFVALUE)
      .name("Fail on scan error")
      .description("Scanning process fails when a scanning a single file fails")
      .onQualifiers(Qualifiers.PROJECT)
      .build()
  );
}
 
开发者ID:I8C,项目名称:sonar-flow-plugin,代码行数:34,代码来源:FlowPlugin.java

示例15: pluginProperties

import org.sonar.api.config.PropertyDefinition; //导入依赖的package包/类
private static ImmutableList<PropertyDefinition> pluginProperties() {
  return ImmutableList.of(

    PropertyDefinition.builder(FILE_SUFFIXES_KEY)
      .name("File suffixes")
      .description("List of file suffixes that will be scanned.")
      .category(CATEGORY)
      .defaultValue(FILE_SUFFIXES_DEFVALUE)
      .onQualifiers(Qualifiers.PROJECT)
      .build()
  );
}
 
开发者ID:Asqatasun,项目名称:Asqatasun-Sonar-Plugin,代码行数:13,代码来源:TanaguruPlugin.java


注:本文中的org.sonar.api.config.PropertyDefinition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。