KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > model > XMLMetaDataException


1 /*
2  * Copyright 2002 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: XMLMetaDataException.java,v 1.4 2003/02/05 18:15:07 jackknifebarber Exp $
9  */

10
11 package com.triactive.jdo.model;
12
13 import java.net.URL JavaDoc;
14 import javax.jdo.JDOFatalException;
15
16
17 /**
18  * An <tt>XMLMetaDataException</tt> is thrown if a structural or logical error
19  * is encountered in the XML metadata for a given persistence capable class.
20  *
21  * @author <a HREF="mailto:mmartin5@austin.rr.com">Mike Martin</a>
22  * @version $Revision: 1.4 $
23  *
24  * @see ClassMetaData
25  */

26
27 public class XMLMetaDataException extends JDOFatalException
28 {
29     /**
30      * Constructs an XML metadata exception with the specified detail
31      * message.
32      *
33      * @param url the URL of the resource containing the errant XML
34      * metadata.
35      * @param msg the detail message
36      */

37
38     public XMLMetaDataException(URL JavaDoc url, String JavaDoc msg)
39     {
40         super(buildMessage(url, msg));
41     }
42
43
44     /**
45      * Constructs an XML metadata exception with the specified detail
46      * message and nested exception.
47      *
48      * @param url the URL of the resource containing the errant XML
49      * metadata.
50      * @param msg the detail message
51      * @param nested the nested exception(s).
52      */

53
54     public XMLMetaDataException(URL JavaDoc url, String JavaDoc msg, Exception JavaDoc nested)
55     {
56         super(buildMessage(url, msg), nested);
57     }
58
59     private static String JavaDoc buildMessage(URL JavaDoc url, String JavaDoc msg)
60     {
61         return "Error in " + url + ": " + msg;
62     }
63 }
64
Popular Tags