org.sonar.api
Annotation Type Property


@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface Property

Property value can be set in different ways :

Since:
1.10

Required Element Summary
 String key
          Unique key within all plugins.
 String name
           
 
Optional Element Summary
 String category
           
 String defaultValue
          The empty string "" is considered as null, so it's not possible to have empty strings for default values.
 String deprecatedKey
          Relocation of key.
 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.
 String[] options
          Options for *_LIST types
 boolean project
          Is the property displayed in project settings page ?
 String propertySetKey
          A Property of type PropertyType.PROPERTY_SET can reference a set of properties by its key.
 PropertyType type
           
 

Element Detail

key

public abstract 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

public abstract String name

defaultValue

public abstract String defaultValue
The empty string "" is considered as null, so it's not possible to have empty strings for default values.

Default:
""

description

public abstract String description
Default:
""

category

public abstract String category
Since:
2.11
See Also:
PropertyDefinition.category()
Default:
""

project

public abstract boolean project
Is the property displayed in project settings page ?

Default:
false

module

public abstract boolean module
Is the property displayed in module settings page ? A module is a maven sub-project.

Default:
false

global

public abstract boolean global
Is the property displayed in global settings page ?

Default:
true

type

public abstract PropertyType type
Since:
3.0
Default:
org.sonar.api.PropertyType.STRING

options

public abstract 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

public abstract boolean multiValues
Can the property take multiple values. Eg: list of email addresses.

Since:
3.3
Default:
false

propertySetKey

public abstract String propertySetKey
A Property of type PropertyType.PROPERTY_SET can reference a set of properties by its key.

Since:
3.3
Default:
""

fields

public abstract PropertyField[] fields
A Property with fields is considered a property set.

Since:
3.3
Default:
{}

deprecatedKey

public abstract String deprecatedKey
Relocation of key.

Since:
3.4
Default:
""


Copyright © 2009–2015 SonarSource. All rights reserved.