KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > util > UnknownFormatFlagsException


1 /*
2  * @(#)UnknownFormatFlagsException.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
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 1.2, 12/19/03
18  * @since 1.5
19  */

20 public class UnknownFormatFlagsException extends IllegalFormatException JavaDoc {
21
22     private static final long serialVersionUID = 19370506L;
23
24     private String JavaDoc 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 JavaDoc f) {
33     if (f == null)
34         throw new NullPointerException JavaDoc();
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 JavaDoc getFlags() {
44     return flags;
45     }
46
47     // javadoc inherited from Throwable.java
48
public String JavaDoc getMessage() {
49     return "Flags = " + flags;
50     }
51 }
52
Popular Tags