KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > util > FormatFlagsConversionMismatchException


1 /*
2  * @(#)FormatFlagsConversionMismatchException.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 a conversion and flag are incompatible.
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 FormatFlagsConversionMismatchException
21     extends IllegalFormatException JavaDoc
22 {
23     private static final long serialVersionUID = 19120414L;
24
25     private String JavaDoc f;
26
27     private char c;
28
29     /**
30      * Constructs an instance of this class with the specified flag
31      * and conversion.
32      *
33      * @param f
34      * The flag
35      *
36      * @param c
37      * The conversion
38      */

39     public FormatFlagsConversionMismatchException(String JavaDoc f, char c) {
40     if (f == null)
41         throw new NullPointerException JavaDoc();
42     this.f = f;
43     this.c = c;
44     }
45
46     /**
47      * Returns the incompatible flag.
48      *
49      * @return The flag
50      */

51      public String JavaDoc getFlags() {
52     return f;
53     }
54
55     /**
56      * Returns the incompatible conversion.
57      *
58      * @return The conversion
59      */

60     public char getConversion() {
61     return c;
62     }
63
64     public String JavaDoc getMessage() {
65     return "Conversion = " + c + ", Flags = " + f;
66     }
67 }
68
Popular Tags