01: package com.etymon.pj.exception;
02:
03: /**
04: An exception that gets thrown by PjScript.
05: @author Nassib Nassar
06: */
07: public class PjScriptException extends PjException {
08:
09: /**
10: Creates a PjScriptException with detailed arguments.
11: @param message a detailed message.
12: @param lineNumber the line number in the script where the exception occurred.
13: @param source the file or program where the script originated.
14: @param errorType the general class of error.
15: */
16: public PjScriptException(String message, int lineNumber,
17: String source, int errorType) {
18: super (message);
19: _message = message;
20: _lineNumber = lineNumber;
21: _source = source;
22: _errorType = errorType;
23: }
24:
25: public String getMessage() {
26: return _message;
27: }
28:
29: public int getLineNumber() {
30: return _lineNumber;
31: }
32:
33: public String getSource() {
34: return _source;
35: }
36:
37: public int getErrorType() {
38: return _errorType;
39: }
40:
41: public String getFullMessage() {
42: if (_lineNumber == -1) {
43: return "pjscript: " + _source + ": " + _message;
44: } else {
45: return "pjscript: " + _source + ":" + _lineNumber + ": "
46: + _message;
47: }
48: }
49:
50: String _message;
51: int _lineNumber;
52: String _source;
53: int _errorType;
54:
55: }
|