Package org.sonar.api

Annotation Type Property


  • @Retention(RUNTIME)
    @Target(TYPE)
    public @interface Property
    Property value can be set in different ways :
    • System property
    • Batch command-line (-Dfoo=bar in Maven or sonar-runner)
    • Maven pom.xml (element <properties>)
    • Maven settings.xml
    • SonarQube web administration console
    Since:
    1.10
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String key
      Unique key within all plugins.
      java.lang.String name  
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String category  
      java.lang.String defaultValue
      The empty string "" is considered as null, so it's not possible to have empty strings for default values.
      java.lang.String deprecatedKey
      Relocation of key.
      java.lang.String description  
      PropertyField[] fields
      A Property with fields is considered a property set.
      boolean global
      Is the property displayed in global settings page ?
      boolean module
      Is the property displayed in module settings page ? A module is a maven sub-project.
      boolean multiValues
      Can the property take multiple values.
      java.lang.String[] options
      Options for *_LIST types
      boolean project
      Is the property displayed in project settings page ?
      java.lang.String propertySetKey
      Deprecated.
      since 6.1, as it was not used and too complex to maintain.
      PropertyType type  
    • Element Detail

      • key

        java.lang.String key
        Unique key within all plugins. It's recommended to prefix the key by 'sonar.' and the plugin name. Examples : 'sonar.cobertura.reportPath' and 'sonar.cpd.minimumTokens'.
      • name

        java.lang.String name
      • defaultValue

        java.lang.String defaultValue
        The empty string "" is considered as null, so it's not possible to have empty strings for default values.
        Default:
        ""
      • description

        java.lang.String description
        Default:
        ""
      • project

        boolean project
        Is the property displayed in project settings page ?
        Default:
        false
      • module

        boolean module
        Is the property displayed in module settings page ? A module is a maven sub-project.
        Default:
        false
      • global

        boolean global
        Is the property displayed in global settings page ?
        Default:
        true
      • type

        PropertyType type
        Since:
        3.0
        Default:
        org.sonar.api.PropertyType.STRING
      • options

        java.lang.String[] options
        Options for *_LIST types
        Since:
        3.0 Options for property of type PropertyType.SINGLE_SELECT_LIST For example {"property_1", "property_3", "property_3"})., 3.3 Options for property of type PropertyType.METRIC
        If no option is specified, any metric will match.
        If options are specified, all must match for the metric to be displayed.
        Three types of filter are supported key:REGEXP, domain:REGEXP and type:comma_separated__list_of_types.
        For example key:new_.* will match any metric which key starts by new_.
        For example type:INT,FLOAT will match any metric of type INT or FLOAT.
        For example type:NUMERIC will match any metric of numerictype.
        Default:
        {}
      • multiValues

        boolean multiValues
        Can the property take multiple values. Eg: list of email addresses.
        Since:
        3.3
        Default:
        false
      • propertySetKey

        @Deprecated
        java.lang.String propertySetKey
        Deprecated.
        since 6.1, as it was not used and too complex to maintain.
        A Property of type PropertyType.PROPERTY_SET can reference a set of properties by its key.
        Since:
        3.3
        Default:
        ""
      • fields

        PropertyField[] fields
        A Property with fields is considered a property set.
        Since:
        3.3
        Default:
        {}
      • deprecatedKey

        java.lang.String deprecatedKey
        Relocation of key.
        Since:
        3.4
        Default:
        ""