Class ELEnvironment

java.lang.Object
de.businesscode.bcdui.el.ELEnvironment

public class ELEnvironment extends Object
  • Field Details

  • Constructor Details

    • ELEnvironment

      public ELEnvironment(Object bean, String bindName) throws Exception
      creates environment to evaluate on a given bean
      Parameters:
      bean - - the bean for evaluation
      bindName - of the bean to be bound
      Throws:
      Exception
    • ELEnvironment

      public ELEnvironment(jakarta.servlet.http.HttpServletRequest request) throws Exception
      Throws:
      Exception
    • ELEnvironment

      public ELEnvironment(String prefix, Class<?> staticFunctionProvider) throws Exception
      Throws:
      Exception
  • Method Details

    • eval

      public Object eval(String expression)
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception
    • setVariable

      public void setVariable(String variableName, Object value)
    • evaluateExpression

      public static String evaluateExpression(String expression, Object targetBean, 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:
      RuntimeException - in case the targetBean is null or the expression fails to evaluate