1. /*
  2. * @(#)IllegalFormatFlagsException.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 an illegal combination flags is given.
  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 IllegalFormatFlagsException extends IllegalFormatException {
  19. private static final long serialVersionUID = 790824L;
  20. private String flags;
  21. /**
  22. * Constructs an instance of this class with the specified flags.
  23. *
  24. * @param f
  25. * The set of format flags which contain an illegal combination
  26. */
  27. public IllegalFormatFlagsException(String f) {
  28. if (f == null)
  29. throw new NullPointerException();
  30. this.flags = f;
  31. }
  32. /**
  33. * Returns the set of flags which contains an illegal combination.
  34. *
  35. * @return The flags
  36. */
  37. public String getFlags() {
  38. return flags;
  39. }
  40. public String getMessage() {
  41. return "Flags = '" + flags + "'";
  42. }
  43. }