public class ScriptEngineUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canFactoryForExtensionProcessViews(String extension,
Dictionary<String,String> headers)
Determines whether the
ScriptEngineFactory associated with the specified extension supports at least one
of the script names declared by the given OSGi headers assuming they provide a value for the
BundleScriptingConfigurationConstants.JAHIA_MODULE_SCRIPTING_VIEWS header. |
static boolean |
canFactoryProcessViews(ScriptEngineFactory scriptFactory,
Dictionary<String,String> headers)
Determines whether the specified
ScriptEngineFactory supports at least one of the script names
declared by the given OSGi headers assuming they provide a value for the
BundleScriptingConfigurationConstants.JAHIA_MODULE_SCRIPTING_VIEWS header. |
ScriptEngine |
getEngineByName(String name)
Returns an instance of a
ScriptEngine by its name. |
static ScriptEngineUtils |
getInstance() |
ScriptEngine |
scriptEngine(String extension)
Returns an instance of a
ScriptEngine by its file extension. |
public static boolean canFactoryForExtensionProcessViews(String extension, Dictionary<String,String> headers)
ScriptEngineFactory associated with the specified extension supports at least one
of the script names declared by the given OSGi headers assuming they provide a value for the
BundleScriptingConfigurationConstants.JAHIA_MODULE_SCRIPTING_VIEWS header.extension - the extension associated with the factory whose support for views defined in the specified
bundle is to be determinedheaders - the OSGi headers to be checked if declared view technologies defined by the BundleScriptingConfigurationConstants.JAHIA_MODULE_SCRIPTING_VIEWS OSGI header are supported by
the specified ScriptEngineFactorytrue if the specified ScriptEngineFactory can handle at least one of the specified script names,
false otherwise. Note that if the headers contain the BundleScriptingConfigurationConstants.JAHIA_MODULE_HAS_VIEWS
header with a "no" value, we won't look at other headers since the module has indicated that it shouldn't
contain any views so the factory shouldn't attempt to process any it might find.public static boolean canFactoryProcessViews(ScriptEngineFactory scriptFactory, Dictionary<String,String> headers)
ScriptEngineFactory supports at least one of the script names
declared by the given OSGi headers assuming they provide a value for the
BundleScriptingConfigurationConstants.JAHIA_MODULE_SCRIPTING_VIEWS header.scriptFactory - the ScriptEngineFactory whose support for views defined in the specified bundle is to be
determinedheaders - the OSGi headers to be checked if declared view technologies defined by the BundleScriptingConfigurationConstants.JAHIA_MODULE_SCRIPTING_VIEWS OSGI header are
supported by the specified ScriptEngineFactorytrue if the specified ScriptEngineFactory can handle at least one of the specified script names,
false otherwise. Note that if the headers contain the BundleScriptingConfigurationConstants.JAHIA_MODULE_HAS_VIEWS
header with a "no" value, we won't look at other headers since the module has indicated that it shouldn't
contain any views so the factory shouldn't attempt to process any it might find.public static ScriptEngineUtils getInstance()
public ScriptEngine getEngineByName(String name) throws ScriptException
ScriptEngine by its name.name - the name of the script engine to look forScriptEngine by its nameScriptException - in case of a script engine initialization errorpublic ScriptEngine scriptEngine(String extension) throws ScriptException
ScriptEngine by its file extension.extension - the extension of the script engine to look forScriptEngine by its nameScriptException - in case of a script engine initialization errorCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.