KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > util > MissingFormatWidthException


1 /*
2  * @(#)MissingFormatWidthException.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 the format width is required.
12  *
13  * <p> Unless otherwise specified, passing a <tt>null</tt> argument to anyg
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 MissingFormatWidthException extends IllegalFormatException JavaDoc {
21
22     private static final long serialVersionUID = 15560123L;
23
24     private String JavaDoc s;
25
26     /**
27      * Constructs an instance of this class with the specified format
28      * specifier.
29      *
30      * @param s
31      * The format specifier which does not have a width
32      */

33     public MissingFormatWidthException(String JavaDoc s) {
34     if (s == null)
35         throw new NullPointerException JavaDoc();
36     this.s = s;
37     }
38
39     /**
40      * Returns the format specifier which does not have a width.
41      *
42      * @return The format specifier which does not have a width
43      */

44     public String JavaDoc getFormatSpecifier() {
45     return s;
46     }
47
48     public String JavaDoc getMessage() {
49     return s;
50     }
51 }
52
Popular Tags