|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.jexl.ScriptFactory
Creates Script
s. To create a JEXL Script, pass
valid JEXL syntax to the static createScript() method:
String jexl = "y = x * 12 + 44; y = y * 4;"; Script script = ScriptFactory.createScript( jexl );
When an Script
is created, the JEXL syntax is
parsed and verified.
Field Summary | |
---|---|
protected static ScriptFactory |
factory
ScriptFactory is a singleton and this is the private instance fufilling that pattern. |
protected static Log |
log
The Log to which all ScriptFactory messages will be logged. |
protected static Parser |
parser
The singleton ScriptFactory also holds a single instance of Parser . |
Method Summary | |
---|---|
protected Script |
createNewScript(String scriptText)
Creates a new Script based on the string. |
static Script |
createScript(File scriptFile)
Creates a Script from a File containing valid JEXL syntax. |
static Script |
createScript(String scriptText)
Creates a Script from a String containing valid JEXL syntax. |
static Script |
createScript(URL scriptUrl)
Creates a Script from a URL containing valid JEXL syntax. |
protected static ScriptFactory |
getInstance()
Returns the single instance of ScriptFactory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static Log log
protected static Parser parser
Parser
. When parsing expressions, ScriptFactory
synchronizes on Parser.
protected static ScriptFactory factory
Method Detail |
protected static ScriptFactory getInstance()
public static Script createScript(String scriptText) throws Exception
scriptText
- A String containing valid JEXL syntax
Script
which can be executed with a
JexlContext
.
Exception
- An exception can be thrown if there is a
problem parsing the script.public static Script createScript(File scriptFile) throws Exception
File
containing valid JEXL syntax.
This method parses the script and validates the syntax.
scriptFile
- A File
containing valid JEXL syntax.
Must not be null. Must be a readable file.
Script
which can be executed with a
JexlContext
.
Exception
- An exception can be thrown if there is a problem
parsing the script.public static Script createScript(URL scriptUrl) throws Exception
URL
containing valid JEXL syntax.
This method parses the script and validates the syntax.
scriptUrl
- A URL
containing valid JEXL syntax.
Must not be null. Must be a readable file.
Script
which can be executed with a
JexlContext
.
Exception
- An exception can be thrown if there is a problem
parsing the script.protected Script createNewScript(String scriptText) throws Exception
scriptText
- valid Jexl script
Exception
- for a variety of reasons - mostly malformed scripts
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |