Class ELEnvironment


  • public class ELEnvironment
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ELEnvironment​(java.lang.Object bean, java.lang.String bindName)
      creates environment to evaluate on a given bean
      ELEnvironment​(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 scope
      static void main​(java.lang.String[] args)  
      void setVariable​(java.lang.String variableName, java.lang.Object value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 evaluation
        bindName - 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 evaluate
        targetBean - the bean to set into context
        beanBindName - 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