1   /*
2    * %W% %E%
3    *
4    * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
5    * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6    */
7   
8   package java.util;
9   
10  /**
11   * Unchecked exception thrown when an unknown flag is given.
12   *
13   * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
14   * method or constructor in this class will cause a {@link
15   * NullPointerException} to be thrown.
16   *
17   * @version     %I%, %G%
18   * @since 1.5
19   */
20  public class UnknownFormatFlagsException extends IllegalFormatException {
21  
22      private static final long serialVersionUID = 19370506L;
23  
24      private String flags;
25  
26      /**
27       * Constructs an instance of this class with the specified flags.
28       *
29       * @param  f
30       *         The set of format flags which contain an unknown flag
31       */
32      public UnknownFormatFlagsException(String f) {
33      if (f == null)
34          throw new NullPointerException();
35      this.flags = f;
36      }
37  
38      /**
39       * Returns the set of flags which contains an unknown flag.
40       *
41       * @return  The flags
42       */
43      public String getFlags() {
44      return flags;
45      }
46  
47      // javadoc inherited from Throwable.java
48      public String getMessage() {
49      return "Flags = " + flags;
50      }
51  }
52