本文整理汇总了Java中jdk.nashorn.internal.runtime.options.Options.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Options.getString方法的具体用法?Java Options.getString怎么用?Java Options.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.runtime.options.Options
的用法示例。
在下文中一共展示了Options.getString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Context
import jdk.nashorn.internal.runtime.options.Options; //导入方法依赖的package包/类
/**
* Constructor
*
* @param options options from command line or Context creator
* @param errors error manger
* @param out output writer for this Context
* @param err error writer for this Context
* @param appLoader application class loader
* @param classFilter class filter to use
*/
public Context(final Options options, final ErrorManager errors, final PrintWriter out, final PrintWriter err, final ClassLoader appLoader, final ClassFilter classFilter) {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission(NASHORN_CREATE_CONTEXT));
}
this.classFilter = classFilter;
this.env = new ScriptEnvironment(options, out, err);
this._strict = env._strict;
this.appLoader = appLoader;
if (env._loader_per_compile) {
this.scriptLoader = null;
this.uniqueScriptId = null;
} else {
this.scriptLoader = createNewLoader();
this.uniqueScriptId = new AtomicLong();
}
this.errors = errors;
// if user passed -classpath option, make a class loader with that and set it as
// thread context class loader so that script can access classes from that path.
final String classPath = options.getString("classpath");
if (!env._compile_only && classPath != null && !classPath.isEmpty()) {
// make sure that caller can create a class loader.
if (sm != null) {
sm.checkPermission(new RuntimePermission("createClassLoader"));
}
this.classPathLoader = NashornLoader.createClassLoader(classPath);
} else {
this.classPathLoader = null;
}
final int cacheSize = env._class_cache_size;
if (cacheSize > 0) {
classCache = new ClassCache(cacheSize);
}
if (env._persistent_cache) {
codeStore = newCodeStore(this);
}
// print version info if asked.
if (env._version) {
getErr().println("nashorn " + Version.version());
}
if (env._fullversion) {
getErr().println("nashorn full version " + Version.fullVersion());
}
initLoggers();
}
示例2: Context
import jdk.nashorn.internal.runtime.options.Options; //导入方法依赖的package包/类
/**
* Constructor
*
* @param options options from command line or Context creator
* @param errors error manger
* @param out output writer for this Context
* @param err error writer for this Context
* @param appLoader application class loader
* @param classFilter class filter to use
*/
public Context(final Options options, final ErrorManager errors, final PrintWriter out, final PrintWriter err, final ClassLoader appLoader, final ClassFilter classFilter) {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission(NASHORN_CREATE_CONTEXT));
}
this.classFilter = classFilter;
this.env = new ScriptEnvironment(options, out, err);
this._strict = env._strict;
if (env._loader_per_compile) {
this.scriptLoader = null;
this.uniqueScriptId = null;
} else {
this.scriptLoader = createNewLoader();
this.uniqueScriptId = new AtomicLong();
}
this.errors = errors;
// if user passed -classpath option, make a URLClassLoader with that and
// the app loader as the parent.
final String classPath = options.getString("classpath");
if (!env._compile_only && classPath != null && !classPath.isEmpty()) {
// make sure that caller can create a class loader.
if (sm != null) {
sm.checkCreateClassLoader();
}
this.appLoader = NashornLoader.createClassLoader(classPath, appLoader);
} else {
this.appLoader = appLoader;
}
this.dynamicLinker = Bootstrap.createDynamicLinker(this.appLoader, env._unstable_relink_threshold);
final int cacheSize = env._class_cache_size;
if (cacheSize > 0) {
classCache = new ClassCache(this, cacheSize);
}
if (env._persistent_cache) {
codeStore = newCodeStore(this);
}
// print version info if asked.
if (env._version) {
getErr().println("nashorn " + Version.version());
}
if (env._fullversion) {
getErr().println("nashorn full version " + Version.fullVersion());
}
if (Options.getBooleanProperty("nashorn.fields.dual")) {
fieldMode = FieldMode.DUAL;
} else if (Options.getBooleanProperty("nashorn.fields.objects")) {
fieldMode = FieldMode.OBJECTS;
} else {
fieldMode = FieldMode.AUTO;
}
initLoggers();
}
示例3: Context
import jdk.nashorn.internal.runtime.options.Options; //导入方法依赖的package包/类
/**
* Constructor
*
* @param options options from command line or Context creator
* @param errors error manger
* @param out output writer for this Context
* @param err error writer for this Context
* @param appLoader application class loader
* @param classFilter class filter to use
*/
public Context(final Options options, final ErrorManager errors, final PrintWriter out, final PrintWriter err, final ClassLoader appLoader, final ClassFilter classFilter) {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission(NASHORN_CREATE_CONTEXT));
}
this.classFilter = classFilter;
this.env = new ScriptEnvironment(options, out, err);
this._strict = env._strict;
this.appLoader = appLoader;
if (env._loader_per_compile) {
this.scriptLoader = null;
this.uniqueScriptId = null;
} else {
this.scriptLoader = createNewLoader();
this.uniqueScriptId = new AtomicLong();
}
this.errors = errors;
// if user passed -classpath option, make a class loader with that and set it as
// thread context class loader so that script can access classes from that path.
final String classPath = options.getString("classpath");
if (!env._compile_only && classPath != null && !classPath.isEmpty()) {
// make sure that caller can create a class loader.
if (sm != null) {
sm.checkPermission(new RuntimePermission("createClassLoader"));
}
this.classPathLoader = NashornLoader.createClassLoader(classPath);
} else {
this.classPathLoader = null;
}
final int cacheSize = env._class_cache_size;
if (cacheSize > 0) {
classCache = new ClassCache(cacheSize);
}
if (env._persistent_cache) {
codeStore = newCodeStore(this);
}
// print version info if asked.
if (env._version) {
getErr().println("nashorn " + Version.version());
}
if (env._fullversion) {
getErr().println("nashorn full version " + Version.fullVersion());
}
if (Options.getBooleanProperty("nashorn.fields.dual")) {
fieldMode = FieldMode.DUAL;
} else if (Options.getBooleanProperty("nashorn.fields.objects")) {
fieldMode = FieldMode.OBJECTS;
} else {
fieldMode = FieldMode.AUTO;
}
initLoggers();
}
示例4: Context
import jdk.nashorn.internal.runtime.options.Options; //导入方法依赖的package包/类
/**
* Constructor
*
* @param options options from command line or Context creator
* @param errors error manger
* @param out output writer for this Context
* @param err error writer for this Context
* @param appLoader application class loader
* @param classFilter class filter to use
*/
public Context(final Options options, final ErrorManager errors, final PrintWriter out, final PrintWriter err, final ClassLoader appLoader, final ClassFilter classFilter) {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission(NASHORN_CREATE_CONTEXT));
}
this.classFilter = classFilter;
this.env = new ScriptEnvironment(options, out, err);
this._strict = env._strict;
if (env._loader_per_compile) {
this.scriptLoader = null;
this.uniqueScriptId = null;
} else {
this.scriptLoader = createNewLoader();
this.uniqueScriptId = new AtomicLong();
}
this.errors = errors;
// if user passed -classpath option, make a URLClassLoader with that and
// the app loader as the parent.
final String classPath = options.getString("classpath");
if (!env._compile_only && classPath != null && !classPath.isEmpty()) {
// make sure that caller can create a class loader.
if (sm != null) {
sm.checkCreateClassLoader();
}
this.appLoader = NashornLoader.createClassLoader(classPath, appLoader);
} else {
this.appLoader = appLoader;
}
final int cacheSize = env._class_cache_size;
if (cacheSize > 0) {
classCache = new ClassCache(cacheSize);
}
if (env._persistent_cache) {
codeStore = newCodeStore(this);
}
// print version info if asked.
if (env._version) {
getErr().println("nashorn " + Version.version());
}
if (env._fullversion) {
getErr().println("nashorn full version " + Version.fullVersion());
}
if (Options.getBooleanProperty("nashorn.fields.dual")) {
fieldMode = FieldMode.DUAL;
} else if (Options.getBooleanProperty("nashorn.fields.objects")) {
fieldMode = FieldMode.OBJECTS;
} else {
fieldMode = FieldMode.AUTO;
}
initLoggers();
}
示例5: Context
import jdk.nashorn.internal.runtime.options.Options; //导入方法依赖的package包/类
/**
* Constructor
*
* @param options options from command line or Context creator
* @param errors error manger
* @param out output writer for this Context
* @param err error writer for this Context
* @param appLoader application class loader
*/
public Context(final Options options, final ErrorManager errors, final PrintWriter out, final PrintWriter err, final ClassLoader appLoader) {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission(NASHORN_CREATE_CONTEXT));
}
this.env = new ScriptEnvironment(options, out, err);
this._strict = env._strict;
this.appLoader = appLoader;
if (env._loader_per_compile) {
this.scriptLoader = null;
this.uniqueScriptId = null;
} else {
this.scriptLoader = createNewLoader();
this.uniqueScriptId = new AtomicLong();
}
this.errors = errors;
this.uniqueEvalId = new AtomicLong();
// if user passed -classpath option, make a class loader with that and set it as
// thread context class loader so that script can access classes from that path.
final String classPath = options.getString("classpath");
if (! env._compile_only && classPath != null && !classPath.isEmpty()) {
// make sure that caller can create a class loader.
if (sm != null) {
sm.checkPermission(new RuntimePermission("createClassLoader"));
}
this.classPathLoader = NashornLoader.createClassLoader(classPath);
} else {
this.classPathLoader = null;
}
// print version info if asked.
if (env._version) {
getErr().println("nashorn " + Version.version());
}
if (env._fullversion) {
getErr().println("nashorn full version " + Version.fullVersion());
}
}
示例6: Context
import jdk.nashorn.internal.runtime.options.Options; //导入方法依赖的package包/类
/**
* Constructor
*
* @param options options from command line or Context creator
* @param errors error manger
* @param out output writer for this Context
* @param err error writer for this Context
* @param appLoader application class loader
*/
public Context(final Options options, final ErrorManager errors, final PrintWriter out, final PrintWriter err, final ClassLoader appLoader) {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission(NASHORN_CREATE_CONTEXT));
}
this.env = new ScriptEnvironment(options, out, err);
this._strict = env._strict;
this.appLoader = appLoader;
if (env._loader_per_compile) {
this.scriptLoader = null;
this.uniqueScriptId = null;
} else {
this.scriptLoader = createNewLoader();
this.uniqueScriptId = new AtomicLong();
}
this.errors = errors;
// if user passed -classpath option, make a class loader with that and set it as
// thread context class loader so that script can access classes from that path.
final String classPath = options.getString("classpath");
if (! env._compile_only && classPath != null && !classPath.isEmpty()) {
// make sure that caller can create a class loader.
if (sm != null) {
sm.checkPermission(new RuntimePermission("createClassLoader"));
}
this.classPathLoader = NashornLoader.createClassLoader(classPath);
} else {
this.classPathLoader = null;
}
// print version info if asked.
if (env._version) {
getErr().println("nashorn " + Version.version());
}
if (env._fullversion) {
getErr().println("nashorn full version " + Version.fullVersion());
}
}