001 /*
002 * SonarQube, open source software quality management tool.
003 * Copyright (C) 2008-2014 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * SonarQube 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 * SonarQube 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 */
020 package org.sonar.api;
021
022 import java.lang.annotation.ElementType;
023 import java.lang.annotation.Retention;
024 import java.lang.annotation.RetentionPolicy;
025 import java.lang.annotation.Target;
026
027 /**
028 * Property field.
029 *
030 * @since 3.3
031 */
032 @Retention(RetentionPolicy.RUNTIME)
033 @Target(ElementType.TYPE)
034 public @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 int indicativeSize() default 20;
060
061 PropertyType type() default PropertyType.STRING;
062
063 /**
064 * Options for *_LIST types
065 */
066 String[] options() default {};
067 }