org.kuali.rice.krad.uif.util
Class ExpressionUtils

java.lang.Object
  extended by 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 Summary
ExpressionUtils()
           
 
Method Summary
static void evaluateCurrentStack(String stack, List<String> controlNames)
          Used internally by parseExpression to evalute if the current stack is a property name (ie, will be a control on the form)
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.
static void populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable, boolean buildRefreshGraphs)
          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)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionUtils

public ExpressionUtils()
Method Detail

populatePropertyExpressionsFromGraph

public static void populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable,
                                                        boolean buildRefreshGraphs)
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
buildRefreshGraphs - indicates whether the expression graphs for component refresh should be built

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:

evaluateCurrentStack

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

Parameters:
stack -
controlNames -


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.