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); }
@Override public void addScript(FacesContext facesContext, String script) { scripts.add(ScriptFactory.getScriptInstance(facesContext.getExternalContext(), script)); }
@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)); }
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); }
/** * 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); }
/** * @deprecated Call {@link #getScriptInstance(ExternalContext, String)} instead. * * <p>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.</p> * * @param sourceCode The source code of the script. */ @Deprecated public static Script getScriptInstance(String sourceCode) { return getScriptInstance(FacesContext.getCurrentInstance().getExternalContext(), sourceCode); }
script = scriptFactory.getAlloyScript(bufferedScriptString, use.split(",")); script = scriptFactory.getScript(bufferedScriptString);
/** * 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); }
/** * @deprecated Call {@link #getScriptInstance(ExternalContext, String, String[], Script.ModulesType)} instead. * * <p>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.</p> * * @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. */ @Deprecated public static Script getScriptInstance(String sourceCode, String[] modules, Script.ModulesType modulesType) { return getScriptInstance(FacesContext.getCurrentInstance().getExternalContext(), sourceCode, modules, modulesType); }
script = scriptFactory.getAlloyScript(bufferedScriptString, use.split(",")); script = scriptFactory.getScript(bufferedScriptString);
protected void renderScript(FacesContext facesContext, String bufferedScriptString, String[] modules, Script.ModulesType modulesType) { Script script; if (modules != null) { script = ScriptFactory.getScriptInstance(facesContext.getExternalContext(), bufferedScriptString, modules, modulesType); } else { script = ScriptFactory.getScriptInstance(facesContext.getExternalContext(), bufferedScriptString); } FacesRequestContext facesRequestContext = FacesRequestContext.getCurrentInstance(); facesRequestContext.addScript(script); }
script = ScriptFactory.getScriptInstance(externalContext, bufferedScriptString, modules, Script.ModulesType.ALLOY); script = ScriptFactory.getScriptInstance(externalContext, bufferedScriptString);