View Javadoc

1   /*
2    * Copyright (c) 2001 - 2005 ivata limited.
3    * All rights reserved.
4    * -----------------------------------------------------------------------------
5    * ivata masks may be redistributed under the GNU General Public
6    * License as published by the Free Software Foundation;
7    * version 2 of the License.
8    *
9    * These programs are free software; you can redistribute them and/or
10   * modify them under the terms of the GNU General Public License
11   * as published by the Free Software Foundation; version 2 of the License.
12   *
13   * These programs are distributed in the hope that they will be useful,
14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16   *
17   * See the GNU General Public License in the file LICENSE.txt for more
18   * details.
19   *
20   * If you would like a copy of the GNU General Public License write to
21   *
22   * Free Software Foundation, Inc.
23   * 59 Temple Place - Suite 330
24   * Boston, MA 02111-1307, USA.
25   *
26   *
27   * To arrange commercial support and licensing, contact ivata at
28   *                  http://www.ivata.com/contact.jsp
29   * -----------------------------------------------------------------------------
30   * $Log: ValueObjectException.java,v $
31   * Revision 1.5  2005/04/09 18:04:19  colinmacleod
32   * Changed copyright text to GPL v2 explicitly.
33   *
34   * Revision 1.4  2005/01/19 13:14:02  colinmacleod
35   * Renamed CausedByException to SystemException.
36   *
37   * Revision 1.3  2005/01/07 08:08:25  colinmacleod
38   * Moved up a version number.
39   * Changed copyright notices to 2005.
40   * Updated the documentation:
41   *   - started working on multiproject:site docu.
42   *   - changed the logo.
43   * Added checkstyle and fixed LOADS of style issues.
44   * Added separate thirdparty subproject.
45   * Added struts (in web), util and webgui (in webtheme) from ivata op.
46   *
47   * Revision 1.2  2004/11/12 15:10:42  colinmacleod
48   * Moved persistence classes from ivata op as a replacement for
49   ValueObjectLocator.
50   *
51   * Revision 1.1.1.1  2004/05/16 20:40:32  colinmacleod
52   * Ready for 0.1 release
53   * -----------------------------------------------------------------------------
54   */
55  package com.ivata.mask.web.struts;
56  import com.ivata.mask.util.SystemException;
57  /***
58   * <p>
59   * Thrown whenever there is a problem creating a value object.
60   * </p>
61   *
62   * @since ivata masks 0.3 (2004-05-10)
63   * @author Colin MacLeod
64   * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
65   * @version $Revision: 1.5 $
66   */
67  public class ValueObjectException extends SystemException {
68      /***
69       * <p>
70       * The class of value object we were trying to create. Can be
71       * <code>null</code>.
72       * </p>
73       */
74      private Class valueObjectClass;
75      /***
76       * <p>
77       * Create a value object exception, given a clear message.
78       * </p>
79       *
80       * @param message
81       *            message describing what went wrong.
82       */
83      public ValueObjectException(final String message) {
84          super(message);
85      }
86      /***
87       * <p>
88       * Create a value object exception, given the cause.
89       * </p>
90       *
91       * @param cause
92       *            exception which caused the problem to happen.
93       */
94      public ValueObjectException(final Throwable cause) {
95          super(cause);
96      }
97      /***
98       * <p>
99       * Create a value object exception, given the cause and the class of the
100      * value object.
101      * </p>
102      *
103      * @param cause
104      *            exception which caused the problem to happen.
105      * @param valueObjectClassParam
106      *            The class of value object we were trying to create. Can be
107      *            <code>null</code>.
108      */
109     public ValueObjectException(final Throwable cause,
110             final Class valueObjectClassParam) {
111         super(cause);
112         this.valueObjectClass = valueObjectClassParam;
113     }
114     /***
115      * <p>
116      * Create a value object exception, given the cause and the class of the
117      * value object and an extra description of what went wrong.
118      * </p>
119      *
120      * @param cause
121      *            exception which caused the problem to happen.
122      * @param valueObjectClassParam
123      *            The class of value object we were trying to create. Can be
124      *            <code>null</code>.
125      * @param message
126      *            describes what went wrong.
127      */
128     public ValueObjectException(final Throwable cause,
129                 final Class valueObjectClassParam,
130                 final String message) {
131         super(message, cause);
132         this.valueObjectClass = valueObjectClassParam;
133     }
134 }
135