Package bsh

Examples of bsh.Interpreter.source()


            if (bsh == null) {
                bsh = createInterpreter(in, out, err, false);
            }

            String file = ARG_FILE.getValue().toString();
            ret = bsh.source(file);

            if (ret != null) {
                out.write((ret + "\n").getBytes());
            }
        }
View Full Code Here


                    classname = file.getName();
                    classname = classname.substring(0, classname.length() - 4);
                    Interpreter i = new Interpreter(); // Construct an interpreter
                    BshClassManager bsh = i.getClassManager();
                    if (!bsh.classExists(classname)) {
                        i.source(url.getFile());
                    }
                    ti = bsh.classForName(classname);
                } catch (IOException ex) {
                    System.err.println("File missing:" + ex);
                    return null;
View Full Code Here

        for (Object o : arguments.entrySet()) {
            entry = (Map.Entry) o;
            i.set((String) entry.getKey(), entry.getValue());
        }
        if (source) {
            i.source(bshData);
        } else {
            i.eval(bshData);
        }
        return i;
    }
View Full Code Here

                                aBshSource.substring(idx + MTI_MACRO.length());
                    } else {
                        script = aBshSource;
                    }

                    bsh.source(script);
                } catch (Exception e) {
                    warn(e);
                }
            }
        }catch (Exception e){
View Full Code Here

                    bsh.set("header", header);
                if (image != null)
                    bsh.set("image", image);
                bsh.set("evt", evt);
                bsh.set("cfg", cfg);
                Object r = bsh.source(aSource);
                if (r instanceof ISOMsg)
                    m = (ISOMsg) r;
                else
                    m = (ISOMsg) bsh.get("message");
            } catch (TargetError e) {
View Full Code Here

    public void actionPerformed (ActionEvent ev) {
        String bshSource = ev.getActionCommand();
        try {
            Interpreter bsh = new Interpreter ();
            bsh.source (bshSource);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
View Full Code Here

        // deprecated
        i.set("ssh", streamConnection);
       
        i.set("conn", streamConnection);
        i.set("args", args);
        i.source(filePath);
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.