當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。