1. /*
  2. * @(#)Messager.java 1.2 04/07/27
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.mirror.apt;
  8. import com.sun.mirror.util.SourcePosition;
  9. /**
  10. * A <tt>Messager</tt> provides the way for
  11. * an annotation processor to report error messages, warnings, and
  12. * other notices.
  13. *
  14. * @author Joseph D. Darcy
  15. * @author Scott Seligman
  16. * @version 1.2 04/07/27
  17. * @since 1.5
  18. */
  19. public interface Messager {
  20. /**
  21. * Prints an error message.
  22. * Equivalent to <tt>printError(null, msg)</tt>.
  23. * @param msg the message, or an empty string if none
  24. */
  25. void printError(String msg);
  26. /**
  27. * Prints an error message.
  28. * @param pos the position where the error occured, or null if it is
  29. * unknown or not applicable
  30. * @param msg the message, or an empty string if none
  31. */
  32. void printError(SourcePosition pos, String msg);
  33. /**
  34. * Prints a warning message.
  35. * Equivalent to <tt>printWarning(null, msg)</tt>.
  36. * @param msg the message, or an empty string if none
  37. */
  38. void printWarning(String msg);
  39. /**
  40. * Prints a warning message.
  41. * @param pos the position where the warning occured, or null if it is
  42. * unknown or not applicable
  43. * @param msg the message, or an empty string if none
  44. */
  45. void printWarning(SourcePosition pos, String msg);
  46. /**
  47. * Prints a notice.
  48. * Equivalent to <tt>printNotice(null, msg)</tt>.
  49. * @param msg the message, or an empty string if none
  50. */
  51. void printNotice(String msg);
  52. /**
  53. * Prints a notice.
  54. * @param pos the position where the noticed occured, or null if it is
  55. * unknown or not applicable
  56. * @param msg the message, or an empty string if none
  57. */
  58. void printNotice(SourcePosition pos, String msg);
  59. }