KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > etymon > pj > exception > PjScriptException


1 package com.etymon.pj.exception;
2
3 /**
4    An exception that gets thrown by PjScript.
5    @author Nassib Nassar
6 */

7 public class PjScriptException
8     extends PjException {
9
10     /**
11        Creates a PjScriptException with detailed arguments.
12        @param message a detailed message.
13        @param lineNumber the line number in the script where the exception occurred.
14        @param source the file or program where the script originated.
15        @param errorType the general class of error.
16     */

17     public PjScriptException(String JavaDoc message, int lineNumber, String JavaDoc source, int errorType) {
18         super(message);
19         _message = message;
20         _lineNumber = lineNumber;
21         _source = source;
22         _errorType = errorType;
23     }
24     
25     public String JavaDoc getMessage() {
26         return _message;
27     }
28
29     public int getLineNumber() {
30         return _lineNumber;
31     }
32
33     public String JavaDoc getSource() {
34         return _source;
35     }
36
37     public int getErrorType() {
38         return _errorType;
39     }
40
41     public String JavaDoc getFullMessage() {
42         if (_lineNumber == -1) {
43             return "pjscript: " + _source + ": " + _message;
44         } else {
45             return "pjscript: " + _source + ":" + _lineNumber + ": " + _message;
46         }
47     }
48     
49     String JavaDoc _message;
50     int _lineNumber;
51     String JavaDoc _source;
52     int _errorType;
53
54 }
55
Popular Tags