KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > util > IllegalFormatCodePointException


1 /*
2  * @(#)IllegalFormatCodePointException.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 character with an invalid Unicode code
12  * point as defined by {@link Character#isValidCodePoint} is passed to the
13  * {@link Formatter}.
14  *
15  * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any
16  * method or constructor in this class will cause a {@link
17  * NullPointerException} to be thrown.
18  *
19  * @version 1.2, 12/19/03
20  * @since 1.5
21  */

22 public class IllegalFormatCodePointException extends IllegalFormatException JavaDoc {
23
24     private static final long serialVersionUID = 19080630L;
25
26     private int c;
27
28     /**
29      * Constructs an instance of this class with the specified illegal code
30      * point as defined by {@link Character#isValidCodePoint}.
31      *
32      * @param c
33      * The illegal Unicode code point
34      */

35     public IllegalFormatCodePointException(int c) {
36     this.c = c;
37     }
38
39     /**
40      * Returns the illegal code point as defined by {@link
41      * Character#isValidCodePoint}.
42      *
43      * @return The illegal Unicode code point
44      */

45     public int getCodePoint() {
46     return c;
47     }
48
49     public String JavaDoc getMessage() {
50
51     return String.format("Code point = %c", c);
52     }
53 }
54
Popular Tags