当前位置: 首页>>代码示例>>Java>>正文


Java Options.getString方法代码示例

本文整理汇总了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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:63,代码来源:Context.java

示例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();
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:71,代码来源:Context.java

示例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();
}
 
开发者ID:malaporte,项目名称:kaziranga,代码行数:71,代码来源:Context.java

示例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();
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:70,代码来源:Context.java

示例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());
    }
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:51,代码来源:Context.java

示例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());
    }
}
 
开发者ID:wro4j,项目名称:nashorn-backport,代码行数:50,代码来源:Context.java


注:本文中的jdk.nashorn.internal.runtime.options.Options.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。