1. /*
  2. * @(#)MissingFormatWidthException.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 the format width is required.
  10. *
  11. * <p> Unless otherwise specified, passing a <tt>null</tt> argument to anyg
  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 MissingFormatWidthException extends IllegalFormatException {
  19. private static final long serialVersionUID = 15560123L;
  20. private String s;
  21. /**
  22. * Constructs an instance of this class with the specified format
  23. * specifier.
  24. *
  25. * @param s
  26. * The format specifier which does not have a width
  27. */
  28. public MissingFormatWidthException(String s) {
  29. if (s == null)
  30. throw new NullPointerException();
  31. this.s = s;
  32. }
  33. /**
  34. * Returns the format specifier which does not have a width.
  35. *
  36. * @return The format specifier which does not have a width
  37. */
  38. public String getFormatSpecifier() {
  39. return s;
  40. }
  41. public String getMessage() {
  42. return s;
  43. }
  44. }