KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > util > UnknownFormatConversionException


1 /*
2  * @(#)UnknownFormatConversionException.java 1.3 04/06/07
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 conversion is given.
12  *
13  * <p> Unless otherwise specified, passing a <tt>null</tt> argument to
14  * any method or constructor in this class will cause a {@link
15  * NullPointerException} to be thrown.
16  *
17  * @version 1.3, 06/07/04
18  * @since 1.5
19  */

20 public class UnknownFormatConversionException extends IllegalFormatException JavaDoc {
21
22     private static final long serialVersionUID = 19060418L;
23
24     private String JavaDoc s;
25
26     /**
27      * Constructs an instance of this class with the unknown conversion.
28      *
29      * @param s
30      * Unknown conversion
31      */

32     public UnknownFormatConversionException(String JavaDoc s) {
33     this.s = s;
34     }
35
36     /**
37      * Returns the unknown conversion.
38      *
39      * @return The unknown conversion.
40      */

41     public String JavaDoc getConversion() {
42     return s;
43     }
44
45     // javadoc inherited from Throwable.java
46
public String JavaDoc getMessage() {
47     return String.format("Conversion = '%s'", s);
48     }
49 }
50
Popular Tags