1. /*
  2. * @(#)FormatFlagsConversionMismatchException.java 1.2 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.util;
  8. /**
  9. * Unchecked exception thrown when a conversion and flag are incompatible.
  10. *
  11. * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
  12. * method or constructor in this class will cause a {@link
  13. * NullPointerException} to be thrown.
  14. *
  15. * @version 1.2, 12/19/03
  16. * @since 1.5
  17. */
  18. public class FormatFlagsConversionMismatchException
  19. extends IllegalFormatException
  20. {
  21. private static final long serialVersionUID = 19120414L;
  22. private String f;
  23. private char c;
  24. /**
  25. * Constructs an instance of this class with the specified flag
  26. * and conversion.
  27. *
  28. * @param f
  29. * The flag
  30. *
  31. * @param c
  32. * The conversion
  33. */
  34. public FormatFlagsConversionMismatchException(String f, char c) {
  35. if (f == null)
  36. throw new NullPointerException();
  37. this.f = f;
  38. this.c = c;
  39. }
  40. /**
  41. * Returns the incompatible flag.
  42. *
  43. * @return The flag
  44. */
  45. public String getFlags() {
  46. return f;
  47. }
  48. /**
  49. * Returns the incompatible conversion.
  50. *
  51. * @return The conversion
  52. */
  53. public char getConversion() {
  54. return c;
  55. }
  56. public String getMessage() {
  57. return "Conversion = " + c + ", Flags = " + f;
  58. }
  59. }