You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Property.java 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Sonar, open source software quality management tool.
  3. * Copyright (C) 2009 SonarSource SA
  4. * mailto:contact AT sonarsource DOT com
  5. *
  6. * Sonar is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * Sonar is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with Sonar; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
  19. */
  20. package org.sonar.api;
  21. import java.lang.annotation.ElementType;
  22. import java.lang.annotation.Retention;
  23. import java.lang.annotation.RetentionPolicy;
  24. import java.lang.annotation.Target;
  25. /**
  26. * Property value can be set in different ways :
  27. * <ul>
  28. * <li>System property</li>
  29. * <li>Maven command-line (-Dfoo=bar)</li>
  30. * <li>Maven pom.xml (element <properties>)</li>
  31. * <li>Maven settings.xml</li>
  32. * <li>Sonar web interface</li>
  33. * </ul>
  34. * <p/>
  35. * Value is accessible in batch extensions via the Configuration object of class <code>org.sonar.api.resources.Project</code>
  36. * (see method <code>getConfiguration()</code>).
  37. * <p/>
  38. * <p><strong>Must be used in <code>org.sonar.api.Plugin</code> classes only.</strong></p>
  39. *
  40. * @since 1.10
  41. */
  42. @Retention(RetentionPolicy.RUNTIME)
  43. @Target(ElementType.TYPE)
  44. public @interface Property {
  45. /**
  46. * Unique key within all plugins. It's recommended to prefix the key by 'sonar.' and the plugin name. Examples :
  47. * 'sonar.cobertura.reportPath' and 'sonar.cpd.minimumTokens'.
  48. */
  49. String key();
  50. String defaultValue() default "";
  51. String name();
  52. String description() default "";
  53. /**
  54. * Is the property displayed in projet settings page ?
  55. */
  56. boolean project() default false;
  57. /**
  58. * Is the property displayed in module settings page ? A module is a maven sub-project.
  59. */
  60. boolean module() default false;
  61. /**
  62. * Is the property displayed in global settings page ?
  63. */
  64. boolean global() default true;
  65. }