@Override public void addScript(String script) { ScriptFactory scriptFactory = (ScriptFactory) FactoryExtensionFinder.getFactory(ScriptFactory.class); scripts.add(scriptFactory.getScript(script)); }
@Override public void addScript(String script) { ScriptFactory scriptFactory = (ScriptFactory) FactoryExtensionFinder.getFactory(ScriptFactory.class); scripts.add(scriptFactory.getScript(script)); }
/** * Returns a new instance of {@link Script} from the {@link ScriptFactory} found by the {@link * FactoryExtensionFinder}. The returned instance is guaranteed to be {@link java.io.Serializable} but not * guaranteed to be thread-safe. * * @param externalContext The external context associated with the current faces context. It is needed in order * for the {@link FactoryExtensionFinder} to be able to find the factory. * @param sourceCode The source code of the script. * * @since 3.1 * @since 2.1 * @since 1.1 */ public static Script getScriptInstance(ExternalContext externalContext, String sourceCode) { ScriptFactory scriptFactory = (ScriptFactory) FactoryExtensionFinder.getFactory(externalContext, ScriptFactory.class); return scriptFactory.getScript(sourceCode); }
/** * Returns a new instance of {@link Script} from the {@link ScriptFactory} found by the {@link * FactoryExtensionFinder}. The returned instance is guaranteed to be {@link java.io.Serializable} but not * guaranteed to be thread-safe. * * @param externalContext The external context associated with the current faces context. It is needed in order * for the {@link FactoryExtensionFinder} to be able to find the factory. * @param sourceCode The source code of the Script. * @param modules The modules which the Script depends on. * @param modulesType The {@link Script.ModulesType} of the Script. * * @since 3.1 * @since 2.1 * @since 1.1 */ public static Script getScriptInstance(ExternalContext externalContext, String sourceCode, String[] modules, Script.ModulesType modulesType) { ScriptFactory scriptFactory = (ScriptFactory) FactoryExtensionFinder.getFactory(externalContext, ScriptFactory.class); return scriptFactory.getScript(sourceCode, modules, modulesType); }
protected void renderScript(FacesContext facesContext, String bufferedScriptString, String[] modules) { Script script; ScriptFactory scriptFactory = (ScriptFactory) FactoryExtensionFinder.getFactory(ScriptFactory.class); if (modules != null) { script = scriptFactory.getAlloyScript(bufferedScriptString, modules); } else { script = scriptFactory.getScript(bufferedScriptString); } FacesRequestContext facesRequestContext = FacesRequestContext.getCurrentInstance(); facesRequestContext.addScript(script); }
protected void renderScript(FacesContext facesContext, String bufferedScriptString, String[] modules) { Script script; ScriptFactory scriptFactory = (ScriptFactory) FactoryExtensionFinder.getFactory(ScriptFactory.class); if (modules != null) { script = scriptFactory.getAlloyScript(bufferedScriptString, modules); } else { script = scriptFactory.getScript(bufferedScriptString); } FacesRequestContext facesRequestContext = FacesRequestContext.getCurrentInstance(); facesRequestContext.addScript(script); }
script = scriptFactory.getScript(bufferedScriptString);
script = scriptFactory.getScript(bufferedScriptString);