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