本文整理匯總了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;
}
}
示例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;
}
示例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;
}
示例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));
}
示例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));
}