01: /*
02: * Copyright 2002 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: XMLMetaDataException.java,v 1.4 2003/02/05 18:15:07 jackknifebarber Exp $
09: */
10:
11: package com.triactive.jdo.model;
12:
13: import java.net.URL;
14: import javax.jdo.JDOFatalException;
15:
16: /**
17: * An <tt>XMLMetaDataException</tt> is thrown if a structural or logical error
18: * is encountered in the XML metadata for a given persistence capable class.
19: *
20: * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
21: * @version $Revision: 1.4 $
22: *
23: * @see ClassMetaData
24: */
25:
26: public class XMLMetaDataException extends JDOFatalException {
27: /**
28: * Constructs an XML metadata exception with the specified detail
29: * message.
30: *
31: * @param url the URL of the resource containing the errant XML
32: * metadata.
33: * @param msg the detail message
34: */
35:
36: public XMLMetaDataException(URL url, String msg) {
37: super (buildMessage(url, msg));
38: }
39:
40: /**
41: * Constructs an XML metadata exception with the specified detail
42: * message and nested exception.
43: *
44: * @param url the URL of the resource containing the errant XML
45: * metadata.
46: * @param msg the detail message
47: * @param nested the nested exception(s).
48: */
49:
50: public XMLMetaDataException(URL url, String msg, Exception nested) {
51: super (buildMessage(url, msg), nested);
52: }
53:
54: private static String buildMessage(URL url, String msg) {
55: return "Error in " + url + ": " + msg;
56: }
57: }
|