1 /***
2 * FilterApplicationException.java
3 *
4 * Project: Dependency Tool
5 *
6 * WHEN WHO WHAT
7 * 06.06.2003 pko initial public release
8 * 28.02.2002 ctr creation
9 *
10 * Copyright 2003 ELCA Informatique SA
11 * Av. de la Harpe 22-24, 1000 Lausanne 13, Switzerland
12 * www.elca.ch
13 *
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public License
16 * as published by the Free Software Foundation; either version 2.1 of
17 * the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 * USA
28 */
29
30 package ch.elca.dependency.exception;
31
32 /***
33 * Wraps the exceptions that could occur during the application of the
34 * include and exclude filters. Because there are many in some cases
35 * technical exceptions which do not tell very much to the user, all
36 * these exceptions are wrapped in the
37 * <code>FilterApplicationException</code>.
38 *
39 * @author Christoph Trutmann
40 * @version 1.0-beta
41 */
42 public class FilterApplicationException extends Exception {
43
44 /***
45 * Standard error message.
46 */
47 private String m_message = "The selected filters cannot be applied.";
48
49 /***
50 * Constructor - Calls the constructor of the supperclass with no arguments.
51 */
52 public FilterApplicationException() {
53 super();
54 }
55
56 /***
57 * Constructor with a specific message string. Calls the corresponding
58 * constructor of the superclass.
59 *
60 * @param msg Message string specified by the user.
61 */
62 public FilterApplicationException(String msg) {
63 super( msg );
64 }
65
66 /***
67 * Constructor with the wrapped exception as an argument.
68 *
69 * @param e A <code>Eception</code> that is wrapped by this class.
70 */
71 public FilterApplicationException(Exception e) {
72 super ( e.getMessage() );
73 }
74
75 /***
76 * Gets the message of the wrapped class and displays it with the standard
77 * message of this exception.
78 *
79 * @return A message string composed of the standard message of this class
80 * plus the message of the wrapped <code>Exception</code>.
81 */
82 public String getMessage() {
83 if (super.getMessage() == null) {
84 return m_message;
85 } else {
86 return m_message +"\n"+ super.getMessage();
87 }
88 }
89 }
This page was automatically generated by Maven