KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cpmake > ScriptException


1 /*
2  * Copyright (c) 2004, Brian Hawkins
3  * brianhks@activeclickweb.com
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the Free
7  * Software Foundation; either version 2 of the License, or (at your option)
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13  * for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the
17  * Free Software Foundation, Inc.,
18  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */

20  
21 package cpmake;
22
23 class ScriptException extends CPMakeException
24     {
25     private int m_line;
26     private String JavaDoc m_file;
27     private String JavaDoc m_message;
28     
29     public ScriptException(int line, String JavaDoc file, String JavaDoc message)
30         {
31         super("", -1);
32         m_line = line;
33         m_file = file;
34         m_message = message;
35         }
36         
37     public String JavaDoc getDescription()
38         {
39         return (toString());
40         }
41         
42     public String JavaDoc toString()
43         {
44         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
45         
46         sb.append("Script error in file "+m_file+" at line "+m_line+"\n");
47         sb.append(m_message);
48         return (sb.toString());
49         }
50     }
51
Popular Tags