|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SlingScript
The SlingScript
defines the API for objects which encapsulate
a script resolved by the SlingScriptResolver
. To have a script
evaluated prepare a SlingBindings
instance of variables used as
global variables to the script and call the eval(SlingBindings)
method.
Objects implementing this interface are returned by the
SlingScriptResolver.findScript(org.apache.sling.api.resource.ResourceResolver, String)
method.
Method Summary | |
---|---|
java.lang.Object |
call(SlingBindings props,
java.lang.String method,
java.lang.Object... args)
Evaluates this script using the bound variables as global variables to the script and then calls the given method with the arguments. |
java.lang.Object |
eval(SlingBindings props)
Evaluates this script using the bound variables as global variables to the script. |
Resource |
getScriptResource()
Returns the Resource providing the script source code. |
Method Detail |
---|
Resource getScriptResource()
java.lang.Object eval(SlingBindings props)
props
- The SlingBindings
providing the bound variables for
evaluating the script. Any bound variables must conform to the
requirements of the SlingBindings
predefined variables
set.
ScriptEvaluationException
- If an error occurrs executing the
script or preparing the script execution. The cause of the
evaluation execption is available as the exception cause.java.lang.Object call(SlingBindings props, java.lang.String method, java.lang.Object... args)
props
- The SlingBindings
providing the bound variables for
evaluating the script. Any bound variables must conform to the
requirements of the SlingBindings
predefined variables
set.method
- The name of the method to call.args
- The arguments for the method call.
ScriptEvaluationException
- If an error occurrs executing the
script or preparing the script execution. The cause of the
evaluation execption is available as the exception cause.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |