001/* 002 * SonarQube 003 * Copyright (C) 2009-2017 SonarSource SA 004 * mailto:info AT sonarsource DOT com 005 * 006 * This program is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 3 of the License, or (at your option) any later version. 010 * 011 * This program is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public License 017 * along with this program; if not, write to the Free Software Foundation, 018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 019 */ 020package org.sonar.api; 021 022import java.lang.annotation.ElementType; 023import java.lang.annotation.Retention; 024import java.lang.annotation.RetentionPolicy; 025import java.lang.annotation.Target; 026 027/** 028 * Property field. 029 * 030 * @since 3.3 031 */ 032@Retention(RetentionPolicy.RUNTIME) 033@Target(ElementType.TYPE) 034public @interface PropertyField { 035 /** 036 * Unique key within a property. It shouldn't be prefixed. 037 * Settings for this field are stored into the database with a composite key 038 * <code>{key of parent property}.{key of the set}.{key of this field}</code> 039 * eg. <code>sonar.jira.servers.JIRA1.url</code> 040 */ 041 String key(); 042 043 /** 044 * This name will be displayed on the Settings page. This can be overridden/translated 045 * by adding a a value for: <code>field.{key of parent property}.{key of this field}.name</code> in the language bundle. 046 */ 047 String name(); 048 049 /** 050 * If not empty, this description will be displayed on the Settings page. This can be overridden/translated 051 * by adding a a value for: <code>field.{key of parent property}.{key of this field}.description</code> in the language bundle. 052 */ 053 String description() default ""; 054 055 /** 056 * Indicative size of the field value in characters. This size is not validated, it is merely used by the GUI 057 * to size the different input fields of a property set. 058 * 059 * @deprecated since 6.1, as it was only used for UI. 060 */ 061 @Deprecated 062 int indicativeSize() default 20; 063 064 PropertyType type() default PropertyType.STRING; 065 066 /** 067 * Options for *_LIST types 068 */ 069 String[] options() default {}; 070}