KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > sco > IncompatibleTypeException


1 /*
2  * Copyright 2004 (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: IncompatibleTypeException.java,v 1.5 2004/01/25 20:44:33 jackknifebarber Exp $
9  */

10
11 package com.triactive.jdo.sco;
12
13 import com.triactive.jdo.SCO;
14
15
16 /**
17  * A <tt>IncompatibleTypeException</tt> is thrown if an incompatible type
18  * is specified as a parameter to a second-class object instance.
19  *
20  * @author <a HREF="mailto:mmartin5@austin.rr.com">Mike Martin</a>
21  * @version $Revision: 1.5 $
22  */

23
24 public class IncompatibleTypeException extends SCOException
25 {
26     /**
27      * Constructs an incompatible type exception.
28      *
29      * @param sco The second-class object.
30      * @param parameter The name of the parameter whose type was invalid.
31      * @param expected The expected type.
32      * @param actual The actual type.
33      */

34
35     public IncompatibleTypeException(SCO sco, String JavaDoc parameter, Class JavaDoc expected, Class JavaDoc actual)
36     {
37         super(sco, "Incompatible " + parameter + " type: was " + actual.getName() + ", should be " + expected.getName());
38     }
39 }
40
Popular Tags