| IllegalFormatFlagsException.java |
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 illegal combination flags 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 IllegalFormatFlagsException extends IllegalFormatException {
21
22 private static final long serialVersionUID = 790824L;
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 illegal combination
31 */
32 public IllegalFormatFlagsException(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 illegal combination.
40 *
41 * @return The flags
42 */
43 public String getFlags() {
44 return flags;
45 }
46
47 public String getMessage() {
48 return "Flags = '" + flags + "'";
49 }
50 }
51