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 1.0KB

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