01: package tcl.lang;
02:
03: /**
04: * This class implements a small helper function that is used to
05: * load the Java package into Jacl.
06: */
07:
08: class JaclLoadJavaCmd implements Command {
09:
10: public void cmdProc(Interp interp, // Current interpreter.
11: TclObject argv[]) // Arguments to "jaclloadjava" statement.
12: throws TclException {
13: // This method takes no arguments
14: if (argv.length != 1) {
15: throw new TclNumArgsException(interp, 1, argv, "");
16: }
17:
18: try {
19: (new BlendExtension()).init(interp);
20: } catch (TclException e) {
21: System.out.println(interp.getResult());
22: e.printStackTrace();
23: throw new TclRuntimeError("unexpected TclException: " + e);
24: }
25:
26: // Now that we have loaded the Java package we can delete this command
27: // from the interp.
28:
29: interp.deleteCommand(argv[0].toString());
30: }
31:
32: }
|