org.ofbiz.base.util
Class Scriptlet
java.lang.Object
org.ofbiz.base.util.Scriptlet
public final class Scriptlet
- extends java.lang.Object
Contains a simple script (scriptlet).
A scriptlet is a small script that is commonly found in a scripting XML file.
The scriptlet is composed of two parts: the prefix - which is the script language
followed by a colon (":"), and the script. Example: groovy:return foo.bar();.
|
Constructor Summary |
Scriptlet(java.lang.String script)
|
|
Method Summary |
java.lang.Object |
executeScript(java.util.Map<java.lang.String,java.lang.Object> context)
Executes the scriptlet and returns the result. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Scriptlet
public Scriptlet(java.lang.String script)
executeScript
public java.lang.Object executeScript(java.util.Map<java.lang.String,java.lang.Object> context)
throws java.lang.Exception
- Executes the scriptlet and returns the result.
- Parameters:
context - The script bindings
- Returns:
- The scriptlet result
- Throws:
java.lang.Exception
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object