1. /*
  2. * @(#)UnknownFormatConversionException.java 1.3 04/06/07
  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 an unknown conversion is given.
  10. *
  11. * <p> Unless otherwise specified, passing a <tt>null</tt> argument to
  12. * any method or constructor in this class will cause a {@link
  13. * NullPointerException} to be thrown.
  14. *
  15. * @version 1.3, 06/07/04
  16. * @since 1.5
  17. */
  18. public class UnknownFormatConversionException extends IllegalFormatException {
  19. private static final long serialVersionUID = 19060418L;
  20. private String s;
  21. /**
  22. * Constructs an instance of this class with the unknown conversion.
  23. *
  24. * @param s
  25. * Unknown conversion
  26. */
  27. public UnknownFormatConversionException(String s) {
  28. this.s = s;
  29. }
  30. /**
  31. * Returns the unknown conversion.
  32. *
  33. * @return The unknown conversion.
  34. */
  35. public String getConversion() {
  36. return s;
  37. }
  38. // javadoc inherited from Throwable.java
  39. public String getMessage() {
  40. return String.format("Conversion = '%s'", s);
  41. }
  42. }