|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jexl.ExpressionFactory
public class ExpressionFactory
Creates Expression objects. To create a JEXL Expression object, pass valid JEXL syntax to the static createExpression() method:
String jexl = "array[1]"; Expression expression = ExpressionFactory.createExpression( jexl );
When an Expression
object is created, the JEXL syntax is
parsed and verified. If the supplied expression is neither an
expression nor a reference, an exception is thrown from createException().
Field Summary | |
---|---|
protected static ExpressionFactory |
ef
ExpressionFactory is a singleton and this is the private instance fufilling that pattern. |
protected static org.apache.commons.logging.Log |
log
The Log to which all ExpressionFactory messages will be logged. |
protected static Parser |
parser
The singleton ExpressionFactory also holds a single instance of Parser . |
Constructor Summary | |
---|---|
private |
ExpressionFactory()
Private constructor, the single instance is always obtained with a call to getInstance(). |
Method Summary | |
---|---|
private java.lang.String |
cleanExpression(java.lang.String expression)
Trims the expression and adds a semi-colon if missing. |
static Expression |
createExpression(java.lang.String expression)
Creates an Expression from a String containing valid JEXL syntax. |
protected Expression |
createNewExpression(java.lang.String expression)
Creates a new Expression based on the expression string. |
protected static ExpressionFactory |
getInstance()
Returns the single instance of ExpressionFactory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected static Parser parser
Parser
.
When parsing expressions, ExpressionFactory synchronizes on Parser.
protected static ExpressionFactory ef
Constructor Detail |
---|
private ExpressionFactory()
Method Detail |
---|
protected static ExpressionFactory getInstance()
public static Expression createExpression(java.lang.String expression) throws java.lang.Exception
expression
- A String containing valid JEXL syntax
java.lang.Exception
- An exception can be thrown if there is a problem
parsing this expression, or if the expression is neither an
expression or a reference.protected Expression createNewExpression(java.lang.String expression) throws java.lang.Exception
expression
- valid Jexl expression
java.lang.Exception
- for a variety of reasons - mostly malformed
Jexl expressionprivate java.lang.String cleanExpression(java.lang.String expression)
expression
- to clean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |