public abstract class ScriptFactory extends Object implements javax.faces.FacesWrapper<ScriptFactory>
Script
which can be rendered on the client via FacesRequestContext.addScript(com.liferay.faces.util.client.Script)
.Constructor and Description |
---|
ScriptFactory() |
Modifier and Type | Method and Description |
---|---|
abstract Script |
getScript(String sourceCode)
Returns a new instance of
Script with the specified source code. |
abstract Script |
getScript(String sourceCode,
String[] modules,
Script.ModulesType modulesType)
Returns a new instance of
Script with the specified source code, modules, and type. |
static Script |
getScriptInstance(javax.faces.context.ExternalContext externalContext,
String sourceCode)
|
static Script |
getScriptInstance(javax.faces.context.ExternalContext externalContext,
String sourceCode,
String[] modules,
Script.ModulesType modulesType)
|
static Script |
getScriptInstance(String sourceCode)
Deprecated.
Call
getScriptInstance(ExternalContext, String) instead.
Returns a new instance of |
static Script |
getScriptInstance(String sourceCode,
String[] modules,
Script.ModulesType modulesType)
Deprecated.
Call
getScriptInstance(ExternalContext, String, String[], Script.ModulesType) instead.
Returns a new instance of |
abstract ScriptFactory |
getWrapped()
Returns the wrapped factory instance if this factory decorates another.
|
@Deprecated public static Script getScriptInstance(String sourceCode)
getScriptInstance(ExternalContext, String)
instead.
Returns a new instance of Script
from the ScriptFactory
found by the FactoryExtensionFinder
. The returned instance is guaranteed to be Serializable
but
not guaranteed to be thread-safe.
sourceCode
- The source code of the script.public static Script getScriptInstance(javax.faces.context.ExternalContext externalContext, String sourceCode)
Script
from the ScriptFactory
found by the FactoryExtensionFinder
. The returned instance is guaranteed to be Serializable
but not
guaranteed to be thread-safe.externalContext
- The external context associated with the current faces context. It is needed in order
for the FactoryExtensionFinder
to be able to find the factory.sourceCode
- The source code of the script.@Deprecated public static Script getScriptInstance(String sourceCode, String[] modules, Script.ModulesType modulesType)
getScriptInstance(ExternalContext, String, String[], Script.ModulesType)
instead.
Returns a new instance of Script
from the ScriptFactory
found by the FactoryExtensionFinder
. The returned instance is guaranteed to be Serializable
but
not guaranteed to be thread-safe.
sourceCode
- The source code of the Script.modules
- The modules which the Script depends on.modulesType
- The Script.ModulesType
of the Script.public static Script getScriptInstance(javax.faces.context.ExternalContext externalContext, String sourceCode, String[] modules, Script.ModulesType modulesType)
Script
from the ScriptFactory
found by the FactoryExtensionFinder
. The returned instance is guaranteed to be Serializable
but not
guaranteed to be thread-safe.externalContext
- The external context associated with the current faces context. It is needed in order
for the FactoryExtensionFinder
to be able to find the factory.sourceCode
- The source code of the Script.modules
- The modules which the Script depends on.modulesType
- The Script.ModulesType
of the Script.public abstract Script getScript(String sourceCode)
Script
with the specified source code. The returned instance is guaranteed to
be Serializable
but not guaranteed to be thread-safe. The Script can be rendered on the client
via FacesRequestContext.addScript(com.liferay.faces.util.client.Script)
.
As a convenience, it is possible to call FacesRequestContext.addScript(java.lang.String)
instead since it will create the
Script and add it to the list of Scripts which will be rendered to the response.sourceCode
- The source code of the Script.public abstract Script getScript(String sourceCode, String[] modules, Script.ModulesType modulesType)
Script
with the specified source code, modules, and type. The returned instance
is guaranteed to be Serializable
but not guaranteed to be thread-safe. The Script can be rendered
on the client via FacesRequestContext.addScript(com.liferay.faces.util.client.Script)
.sourceCode
- The source code of the Script.modules
- The modules which the Script depends on.modulesType
- The Script.ModulesType
of the Script.public abstract ScriptFactory getWrapped()
getWrapped
in interface javax.faces.FacesWrapper<ScriptFactory>
Copyright © 2018 Liferay, Inc.. All rights reserved.