KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > datatypes > DatatypeFormatException


1 /******************************************************************
2  * File: DatatypeFormatException.java
3  * Created by: Dave Reynolds
4  * Created on: 07-Dec-02
5  *
6  * (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: DatatypeFormatException.java,v 1.10 2005/02/21 12:01:51 andy_seaborne Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.datatypes;
11
12 import com.hp.hpl.jena.shared.*;
13
14 /**
15  * Exception thrown when a lexical form does not match the stated
16  * datatype.
17  *
18  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
19  * @version $Revision: 1.10 $ on $Date: 2005/02/21 12:01:51 $
20  */

21 public class DatatypeFormatException extends JenaException
22 {
23     
24     // TODO Could consider storing the lexical form and datatype in locals
25
// with accessors.
26

27     /**
28      * Preferred constructor.
29      * @param lexicalForm the illegal string discovered
30      * @param dtype the datatype that found the problem
31      * @param msg additional context for the error
32      */

33     public DatatypeFormatException(String JavaDoc lexicalForm, RDFDatatype dtype, String JavaDoc msg) {
34         super("Lexical form '" + lexicalForm +
35                "' is not a legal instance of " + dtype + " " + msg);
36     }
37                   
38     /**
39      * Creates a new instance of <code>DatatypeFormatException</code>
40      * without detail message.
41      */

42     public DatatypeFormatException() {
43     }
44     
45     /**
46      * Constructs an instance of <code>DatatypeFormatException</code>
47      * with the specified detail message.
48      * @param msg the detail message.
49      */

50     public DatatypeFormatException(String JavaDoc msg) {
51         super(msg);
52     }
53
54 }
55
56 /*
57     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
58     All rights reserved.
59
60     Redistribution and use in source and binary forms, with or without
61     modification, are permitted provided that the following conditions
62     are met:
63
64     1. Redistributions of source code must retain the above copyright
65        notice, this list of conditions and the following disclaimer.
66
67     2. Redistributions in binary form must reproduce the above copyright
68        notice, this list of conditions and the following disclaimer in the
69        documentation and/or other materials provided with the distribution.
70
71     3. The name of the author may not be used to endorse or promote products
72        derived from this software without specific prior written permission.
73
74     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
75     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
76     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
77     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
78     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
79     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
80     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
81     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
82     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
83     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
84 */

85
Popular Tags