Class ExpressionUtils

java.lang.Object
org.kuali.rice.krad.uif.util.ExpressionUtils

public class ExpressionUtils extends Object
Utility class for UIF expressions
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Constructor Details

    • ExpressionUtils

      public ExpressionUtils()
  • Method Details

    • populatePropertyExpressionsFromGraph

      public static void populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable)
      Pulls expressions within the expressionConfigurable's expression graph and moves them to the property expressions map for the expressionConfigurable or a nested expressionConfigurable (for the case of nested expression property names)

      Expressions that are configured on properties and pulled out by the UifBeanFactoryPostProcessor and put in the UifDictionaryBean.getExpressionGraph() for the bean that is at root (non nested) level. Before evaluating the expressions, they need to be moved to the UifDictionaryBean.getPropertyExpressions() map for the expressionConfigurable that property is on.

      Parameters:
      expressionConfigurable - expressionConfigurable instance to process expressions for
    • parseExpression

      public static String parseExpression(String exp, List<String> controlNames)
      Takes in an expression and a list to be filled in with names(property names) of controls found in the expression. This method returns a js expression which can be executed on the client to determine if the original exp was satisfied before interacting with the server - ie, this js expression is equivalent to the one passed in. There are limitations on the Spring expression language that can be used as this method. It is only used to parse expressions which are valid case statements for determining if some action/processing should be performed. ONLY Properties, comparison operators, booleans, strings, matches expression, and boolean logic are supported. Properties must be a valid property on the form, and should have a visible control within the view. Example valid exp: account.name == 'Account Name'
      Parameters:
      exp -
      controlNames -
      Returns:
      parsed expression, expressed as JS for client side evaluation
    • evaluateCurrentStack

      public static void evaluateCurrentStack(String stack, List<String> controlNames)
      Used internally by parseExpression to evaluate if the current stack is a property name (ie, will be a control on the form)
      Parameters:
      stack -
      controlNames -