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.

SamplePlugin.java 975B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package org.sonar.plugins.sample;
  2. import org.sonar.api.Plugin;
  3. import java.util.ArrayList;
  4. import java.util.List;
  5. /**
  6. * This class is the entry point for all extensions
  7. */
  8. public class SamplePlugin implements Plugin {
  9. /**
  10. * @deprecated this is not used anymore
  11. */
  12. public String getKey() {
  13. return "sample";
  14. }
  15. /**
  16. * @deprecated this is not used anymore
  17. */
  18. public String getName() {
  19. return "My Sonar plugin";
  20. }
  21. /**
  22. * @deprecated this is not used anymore
  23. */
  24. public String getDescription() {
  25. return "You shouldn't expect too much from this plugin except displaying the Hello World message.";
  26. }
  27. // This is where you're going to declare all your Sonar extensions
  28. public List getExtensions() {
  29. return Arrays.asList(SampleMetrics.class, SampleSensor.class, SampleDashboardWidget.class);
  30. }
  31. @Override
  32. public String toString() {
  33. return getClass().getSimpleName();
  34. }
  35. }