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


Java ScriptEngineFactory.getParameter方法代码示例

本文整理汇总了Java中javax.script.ScriptEngineFactory.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Java ScriptEngineFactory.getParameter方法的具体用法?Java ScriptEngineFactory.getParameter怎么用?Java ScriptEngineFactory.getParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.script.ScriptEngineFactory的用法示例。


在下文中一共展示了ScriptEngineFactory.getParameter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isSafeMultiThread

import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
/**
 * Si el scriptEngine es seguro en entornos de multithread
 *
 * @return
 */
private boolean isSafeMultiThread() {
    ScriptEngineFactory scriptEngineFactory = scriptEngine.getFactory();
    String threading = (String) scriptEngineFactory.getParameter("THREADING");

    if (threading == null) {
        return false;
    } else if (threading.equals("MULTITHREADED")) {
        return true;
    } else if (threading.equals("THREAD-ISOLATED")) {
        return true;
    } else if (threading.equals("STATELESS")) {
        return true;
    } else {
        //No sabemos nada sobre el tipo de multithread.
        //debe ser una propiedad nueva de Java.
        return false;
    }
}
 
开发者ID:ix3,项目名称:ix3,代码行数:24,代码来源:ScriptEvaluator.java

示例2: getAvailableLanguages

import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
public static Set<String> getAvailableLanguages(Project project) {
  final List<ScriptEngineFactory> engineFactories = new ScriptEngineManager(composeUserClassLoader(project)).getEngineFactories();

  if (engineFactories != null) {
    final Set<String> availableNames = new TreeSet<String>();
    for (ScriptEngineFactory factory : engineFactories) {
      final String engineName = (String)factory.getParameter(ScriptEngine.NAME);
      availableNames.add(engineName);
    }
    return availableNames;
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:JavaFxInjectPageLanguageIntention.java

示例3: getAvailableLanguages

import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
private static Set<String> getAvailableLanguages(Project project) {
  final List<ScriptEngineFactory> engineFactories = new ScriptEngineManager(composeUserClassLoader(project)).getEngineFactories();

  if (engineFactories != null) {
    final Set<String> availableNames = new TreeSet<String>();
    for (ScriptEngineFactory factory : engineFactories) {
      final String engineName = (String)factory.getParameter(ScriptEngine.NAME);
      availableNames.add(engineName);
    }
    return availableNames;
  }

  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:JavaFxInjectPageLanguageIntention.java

示例4: isThreadSafe

import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
@Override
public boolean isThreadSafe(String key, ScriptEngine instance) {
    final ScriptEngineFactory factory = instance.getFactory();
    final Object threadingAbility = factory.getParameter("THREADING");
    return threadingAbility != null && ("THREAD-ISOLATED".equals(threadingAbility) || "STATELESS".equals(threadingAbility));
}
 
开发者ID:drewwills,项目名称:cernunnos,代码行数:7,代码来源:ScriptEnginePhrase.java

示例5: isThreadSafe

import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
@Override
public boolean isThreadSafe(Tuple<ScriptEngine, String> key, ScriptEvaluator instance) {
    final ScriptEngineFactory factory = key.first.getFactory();
    final Object threadingAbility = factory.getParameter("THREADING");
    return threadingAbility != null && ("THREAD-ISOLATED".equals(threadingAbility) || "STATELESS".equals(threadingAbility));
}
 
开发者ID:drewwills,项目名称:cernunnos,代码行数:7,代码来源:ScriptEvaluatorFactory.java


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