Package de.businesscode.bcdui.el
Class ELEnvironment
- java.lang.Object
-
- de.businesscode.bcdui.el.ELEnvironment
-
public class ELEnvironment extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
EXPRESSION_FACTORY_NAME
-
Constructor Summary
Constructors Constructor Description ELEnvironment(java.lang.Object bean, java.lang.String bindName)
creates environment to evaluate on a given beanELEnvironment(java.lang.String prefix, java.lang.Class<?> staticFunctionProvider)
ELEnvironment(javax.servlet.http.HttpServletRequest request)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
eval(java.lang.String expression)
static java.lang.String
evaluateExpression(java.lang.String expression, java.lang.Object targetBean, java.lang.String beanBindName)
evaluates a String with possible EL with bcdBean in scopestatic void
main(java.lang.String[] args)
void
setVariable(java.lang.String variableName, java.lang.Object value)
-
-
-
Field Detail
-
EXPRESSION_FACTORY_NAME
public static final java.lang.String EXPRESSION_FACTORY_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ELEnvironment
public ELEnvironment(java.lang.Object bean, java.lang.String bindName) throws java.lang.Exception
creates environment to evaluate on a given bean- Parameters:
bean
- - the bean for evaluationbindName
- of the bean to be bound- Throws:
java.lang.Exception
-
ELEnvironment
public ELEnvironment(javax.servlet.http.HttpServletRequest request) throws java.lang.Exception
- Throws:
java.lang.Exception
-
ELEnvironment
public ELEnvironment(java.lang.String prefix, java.lang.Class<?> staticFunctionProvider) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
eval
public java.lang.Object eval(java.lang.String expression)
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setVariable
public void setVariable(java.lang.String variableName, java.lang.Object value)
-
evaluateExpression
public static java.lang.String evaluateExpression(java.lang.String expression, java.lang.Object targetBean, java.lang.String beanBindName)
evaluates a String with possible EL with bcdBean in scope- Parameters:
expression
- to evaluatetargetBean
- the bean to set into contextbeanBindName
- name to bind the bean to in context- Returns:
- either a String if it does not contain expression, or evaluated expression, also may be null
- Throws:
java.lang.RuntimeException
- in case the targetBean is null or the expression fails to evaluate
-
-