01: /*
02: * $Id: ScriptException.java,v 1.10 2002/09/16 08:05:03 jkl Exp $
03: *
04: * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
05: *
06: * Use is subject to license terms, as defined in
07: * Anvil Sofware License, Version 1.1. See LICENSE
08: * file, or http://njet.org/license-1.1.txt
09: */
10: package anvil.script;
11:
12: import anvil.core.Any;
13: import anvil.core.AnyClass;
14: import anvil.core.AnyThrowable;
15:
16: /**
17: * class ScriptException
18: *
19: * @author: Jani Lehtimäki
20: */
21: public class ScriptException extends RuntimeException {
22:
23: private Any _data;
24:
25: public ScriptException(Any data) {
26: super ("ScriptException");
27: _data = data;
28: }
29:
30: public Any getData() {
31: return _data;
32: }
33:
34: public void fillInStackTrace(int index, ClassType classtype,
35: Any instance, String methodName) {
36: //FIXME
37: Function method = (Function) classtype
38: .lookupDeclaration(methodName);
39: if (method != null) {
40: fillInStackTrace(index, (Module) classtype.getParent(),
41: instance, method);
42: }
43: }
44:
45: public void fillInStackTrace(int index, Module module,
46: Any instance, Function method) {
47: if (_data instanceof AnyThrowable) {
48: ((AnyThrowable) _data).fillInStackTrace(index, module,
49: instance, method);
50: }
51: }
52:
53: /*public ScriptException fill(Object obj, int methodIndex, int pos)
54: {
55: if (_data instanceof AnyThrowable) {
56: ((AnyThrowable)_data).fillInStackTrace(obj, methodIndex, pos);
57: }
58: return this;
59: }*/
60:
61: }
|