本文整理汇总了Java中jdk.nashorn.internal.runtime.ScriptEnvironment.getFiles方法的典型用法代码示例。如果您正苦于以下问题:Java ScriptEnvironment.getFiles方法的具体用法?Java ScriptEnvironment.getFiles怎么用?Java ScriptEnvironment.getFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.runtime.ScriptEnvironment
的用法示例。
在下文中一共展示了ScriptEnvironment.getFiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import jdk.nashorn.internal.runtime.ScriptEnvironment; //导入方法依赖的package包/类
/**
* Run method logic.
*
* @param in input stream for Shell
* @param out output stream for Shell
* @param err error stream for Shell
* @param args arguments to Shell
*
* @return exit code
*
* @throws IOException if there's a problem setting up the streams
*/
protected final int run(final InputStream in, final OutputStream out, final OutputStream err, final String[] args) throws IOException {
final Context context = makeContext(in, out, err, args);
if (context == null) {
return COMMANDLINE_ERROR;
}
final Global global = context.createGlobal();
final ScriptEnvironment env = context.getEnv();
final List<String> files = env.getFiles();
if (files.isEmpty()) {
return readEvalPrint(context, global);
}
if (env._compile_only) {
return compileScripts(context, global, files);
}
if (env._fx) {
return runFXScripts(context, global, files);
}
return runScripts(context, global, files);
}
示例2: run
import jdk.nashorn.internal.runtime.ScriptEnvironment; //导入方法依赖的package包/类
/**
* Run method logic.
*
* @param in input stream for Shell
* @param out output stream for Shell
* @param err error stream for Shell
* @param args arguments to Shell
*
* @return exit code
*
* @throws IOException if there's a problem setting up the streams
*/
protected final int run(final InputStream in, final OutputStream out, final OutputStream err, final String[] args) throws IOException {
final Context context = makeContext(in, out, err, args);
if (context == null) {
return COMMANDLINE_ERROR;
}
final ScriptObject global = context.createGlobal();
final ScriptEnvironment env = context.getEnv();
final List<String> files = env.getFiles();
if (files.isEmpty()) {
return readEvalPrint(context, global);
}
if (env._compile_only) {
return compileScripts(context, global, files);
}
if (env._fx) {
return runFXScripts(context, global, files);
}
return runScripts(context, global, files);
}