public static PrintStream getOut() { return getGlobal().getOut(); }
public static PrintStream getOut() { return getGlobal().getOut(); }
public static PrintStream getOut() { return getGlobal().getOut(); }
/** * Print a help message. * * This method is defined as a JavaScript function. */ public static void help(Context cx, Scriptable thisObj, Object[] args, Function funObj) { PrintStream out = getInstance(funObj).getOut(); out.println(ToolErrorReporter.getMessage("msg.help")); }
/** * Print a help message. * * This method is defined as a JavaScript function. */ public static void help(Context cx, Scriptable thisObj, Object[] args, Function funObj) { PrintStream out = getInstance(funObj).getOut(); out.println(ToolErrorReporter.getMessage("msg.help")); }
/** * Print a help message. * * This method is defined as a JavaScript function. */ public static void help(Context cx, Scriptable thisObj, Object[] args, Function funObj) { PrintStream out = getInstance(funObj).getOut(); out.println(ToolErrorReporter.getMessage("msg.help")); }
/** * Print the string values of its arguments. * * This method is defined as a JavaScript function. * Note that its arguments are of the "varargs" form, which * allows it to handle an arbitrary number of arguments * supplied to the JavaScript function. * */ public static Object print(Context cx, Scriptable thisObj, Object[] args, Function funObj) { PrintStream out = getInstance(funObj).getOut(); for (int i=0; i < args.length; i++) { if (i > 0) out.print(" "); // Convert the arbitrary JavaScript value into a string form. String s = Context.toString(args[i]); out.print(s); } out.println(); return Context.getUndefinedValue(); }
/** * Print the string values of its arguments. * * This method is defined as a JavaScript function. * Note that its arguments are of the "varargs" form, which * allows it to handle an arbitrary number of arguments * supplied to the JavaScript function. * */ public static Object print(Context cx, Scriptable thisObj, Object[] args, Function funObj) { PrintStream out = getInstance(funObj).getOut(); for (int i=0; i < args.length; i++) { if (i > 0) out.print(" "); // Convert the arbitrary JavaScript value into a string form. String s = Context.toString(args[i]); out.print(s); } out.println(); return Context.getUndefinedValue(); }
/** * Print the string values of its arguments. * * This method is defined as a JavaScript function. * Note that its arguments are of the "varargs" form, which * allows it to handle an arbitrary number of arguments * supplied to the JavaScript function. * */ public static Object print(Context cx, Scriptable thisObj, Object[] args, Function funObj) { PrintStream out = getInstance(funObj).getOut(); for (int i=0; i < args.length; i++) { if (i > 0) out.print(" "); // Convert the arbitrary JavaScript value into a string form. String s = Context.toString(args[i]); out.print(s); } out.println(); return Context.getUndefinedValue(); }
static void processFiles(Context cx, String[] files) throws IOException { StringBuffer cout = new StringBuffer(); if (files.length > 0) { for (int i=0; i < files.length; i++) { try { String source = (String)readFileOrUrl(files[i], true); cout.append(Compressor.compressScript(source, 0, 1, escapeUnicode, stripConsole)); } catch(IOException ex) { // continue processing files } } } else { byte[] data = Kit.readStream(global.getIn(), 4096); // Convert to String using the default encoding String source = new String(data); if (source != null) { cout.append(Compressor.compressScript(source, 0, 1, escapeUnicode, stripConsole)); } } global.getOut().println(cout); }
arg.equals("-help")) { global.getOut().println( ToolErrorReporter.getMessage("msg.shell.usage", Main.class.getName())); System.exit(1); global.getOut().println( ToolErrorReporter.getMessage("msg.shell.invalid", usageError)); global.getOut().println( ToolErrorReporter.getMessage("msg.shell.usage", Main.class.getName())); System.exit(1);
i++; PrintStream savedOut = this.getOut(); PrintStream savedErr = this.getErr(); ByteArrayOutputStream out = new ByteArrayOutputStream();
i++; PrintStream savedOut = this.getOut(); PrintStream savedErr = this.getErr(); ByteArrayOutputStream out = new ByteArrayOutputStream();
arg.equals("-help")) { global.getOut().println( ToolErrorReporter.getMessage("msg.shell.usage", Main.class.getName())); System.exit(1); global.getOut().println( ToolErrorReporter.getMessage("msg.shell.invalid", usageError)); global.getOut().println( ToolErrorReporter.getMessage("msg.shell.usage", Main.class.getName())); System.exit(1);
i++; PrintStream savedOut = this.getOut(); PrintStream savedErr = this.getErr(); ByteArrayOutputStream out = new ByteArrayOutputStream();
arg.equals("-help")) { global.getOut().println( ToolErrorReporter.getMessage("msg.shell.usage", Main.class.getName())); System.exit(1); global.getOut().println( ToolErrorReporter.getMessage("msg.shell.invalid", usageError)); global.getOut().println( ToolErrorReporter.getMessage("msg.shell.usage", Main.class.getName())); System.exit(1);
out = (global != null) ? global.getOut() : System.out;
out = (global != null) ? global.getOut() : System.out;
out = (global != null) ? global.getOut() : System.out;