View Javadoc

1   /* ==============================================================================
2    *   JDBCAdmin, data management software.
3    *   Copyright (C) 2005  Norsys S.A
4    *
5    *   This library is free software; you can redistribute it and/or
6    *   modify it under the terms of the GNU Lesser General Public
7    *   License as published by the Free Software Foundation; either
8    *   version 2.1 of the License, or (at your option) any later version.
9    *
10   *   This library is distributed in the hope that it will be useful,
11   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   *   Lesser General Public License for more details.
14   *
15   *   You should have received a copy of the GNU Lesser General Public
16   *   License along with this library; if not, write to the Free Software
17   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18   * ==============================================================================
19   */
20  package jdbcadmin.core.exceptions;
21  
22  import org.apache.commons.lang.exception.NestableException;
23  
24  /***
25   * Exception thrown for convertion errors
26   * @author Thomas Recloux (trecloux@norsys.fr)
27   */
28  public class ConvertionException extends NestableException {
29  
30      /* ----------------------------------------- Constructors */
31  //    /***
32  //     * Constructor which set up the message, the name of the concerned property
33  //     * and a sample value.
34  //     * @param aMessage The exception message
35  //     * @param aSampleValue The sample value
36  //     * @param aPropertyName The name of the property
37  //     */
38  //    public ConvertionException(String aMessage, String aSampleValue, String aPropertyName) {
39  //        super(aMessage);
40  //        this.propertyName = aPropertyName;
41  //        this.sampleValue = aSampleValue;
42  //    }
43  
44      /***
45       * Constructor which set up the message, the name of the concerned property
46       * , a sample value and the source exception.
47       * @param aMessage The exception message
48       * @param aSampleValue The sample value
49       * @param aPropertyName The name of the property
50       * @param aSource source exception
51       */
52      public ConvertionException(String aMessage, String aPropertyName, String aSampleValue, Throwable aSource) {
53          super(aMessage, aSource);
54          this.propertyName = aPropertyName;
55          this.sampleValue = aSampleValue;
56      }
57  
58      /* ----------------------------------------- Attributes */
59      /*** Name of the property concerned by the convertion error. */
60      private String propertyName;
61  
62      /*** sample value. */
63      private String sampleValue;
64  
65      /* ----------------------------------------- Accessors */
66  
67      /***
68       * @return Returns the propertyName.
69       */
70      public String getPropertyName() {
71          return propertyName;
72      }
73  
74      /***
75       * @return Returns the sampleValue.
76       */
77      public String getSampleValue() {
78          return sampleValue;
79      }
80  
81  }