KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > swing > binding > BindException


1 /*
2  * $Id: BindException.java,v 1.1.1.1 2004/06/16 01:43:39 davidson1 Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.swing.binding;
9
10 /**
11  * Thrown when a binding could not be established between a user-interface
12  * component and a data model.
13  *
14  * @author Amy Fowler
15  * @version 1.0
16  */

17 public class BindException extends Exception JavaDoc {
18
19     /**
20      * Instantiates a bind exception.
21      * @param dataModel data model object which could not be bound
22      */

23     public BindException(Object JavaDoc dataModel) {
24         this("could not bind to "+dataModel.getClass().getName());
25     }
26
27     /**
28      * Instantiates a bind exception.
29      * @param dataModel data model object which could not be bound
30      * @param cause the specific throwable which caused the bind failure
31      */

32     public BindException(Object JavaDoc dataModel, Throwable JavaDoc cause) {
33         this("could not bind to "+dataModel.getClass().getName(), cause);
34     }
35
36     /**
37      * Instantiates a bind exception.
38      * @param dataModel data model object which could not be bound
39      * @param fieldName string containing the name of the field or element
40      * within the data model
41      */

42     public BindException(Object JavaDoc dataModel, String JavaDoc fieldName) {
43         this("could not bind to field"+fieldName+" on "+dataModel.getClass().getName());
44     }
45
46     /**
47      * Instantiates a bind exception.
48      * @param dataModel data model object which could not be bound
49      * @param fieldName string containing the name of the field or element
50      * within the data model
51      * @param cause the specific throwable which caused the bind failure
52      */

53     public BindException(Object JavaDoc dataModel, String JavaDoc fieldName, Throwable JavaDoc cause) {
54         this("could not bind to field"+fieldName+" on "+dataModel.getClass().getName(),
55              cause);
56     }
57
58
59     /**
60      * Instantiates bind exception.
61      * @param message String containing description of why exception occurred
62      */

63     public BindException(String JavaDoc message) {
64         super(message);
65     }
66
67     /**
68      * Instantiates bind exception.
69      * @param message String containing description of why exception occurred
70      * @param cause the specific throwable which caused bind failure
71      */

72     public BindException(String JavaDoc message, Throwable JavaDoc cause) {
73         super(message, cause);
74     }
75
76 }
77
Popular Tags