test_class.file: rice-framework/krad-web-framework/src/test/java/org/kuali/rice/krad/uif/util/ExpressionUtilsTest.java
test_class.identifier: ExpressionUtilsTest
test_case.body: @Test
      public void testPopulatePropertyExpressionsFromGraph_RefreshGraphs() {
          Map<String, String> expressionGraph = new HashMap<String, String>();
  
          expressionGraph.put("property1", "@{expr1}");
          expressionGraph.put("property2", "@{expr2}");
          expressionGraph.put("property3['key1']", "@{key1expr}");
          expressionGraph.put("property4.property1", "@{nexpr1}");
          expressionGraph.put("property4.property4.property3['key2']", "@{nkey2expr}");
  
          MockConfigurable configurable = new MockConfigurable();
          MockConfigurable configurable2 = new MockConfigurable();
          MockConfigurable configurable3 = new MockConfigurable();
  
          configurable2.setProperty4(configurable3);
          configurable.setProperty4(configurable2);
  
          configurable.setExpressionGraph(expressionGraph);
  
          ViewLifecycle.getExpressionEvaluator().populatePropertyExpressionsFromGraph(configurable, true);
      }
test_case.class_method_signature: ExpressionUtilsTest.testPopulatePropertyExpressionsFromGraph_RefreshGraphs()
test_case.full_signature: @Test public void testPopulatePropertyExpressionsFromGraph_RefreshGraphs()
test_case.identifier: testPopulatePropertyExpressionsFromGraph_RefreshGraphs
test_case.invocations: put put put put put setProperty4 setProperty4 setExpressionGraph populatePropertyExpressionsFromGraph getExpressionEvaluator
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPopulatePropertyExpressionsFromGraph_RefreshGraphs()
focal_class.declarator: LOG = LogFactory.getLog(ExpressionUtils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Log LOG = LogFactory.getLog(ExpressionUtils.class);
focal_class.type: Log
focal_class.var_name: LOG
focal_class.file: rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/uif/util/ExpressionUtils.java
focal_class.identifier: ExpressionUtils
focal_class.class_method_signature: ExpressionUtils.populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable)
focal_class.full_signature: public static void populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable)
focal_class.identifier: populatePropertyExpressionsFromGraph
focal_class.modifiers: public static
focal_class.parameters: (UifDictionaryBean expressionConfigurable)
focal_class.return: void
focal_class.signature: void populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable)
focal_class.class_method_signature: ExpressionUtils.parseExpression(String exp, List<String> controlNames)
focal_class.full_signature: public static String parseExpression(String exp, List<String> controlNames)
focal_class.identifier: parseExpression
focal_class.modifiers: public static
focal_class.parameters: (String exp, List<String> controlNames)
focal_class.return: String
focal_class.signature: String parseExpression(String exp, List<String> controlNames)
focal_class.class_method_signature: ExpressionUtils.evaluateCurrentStack(String stack, List<String> controlNames)
focal_class.full_signature: public static void evaluateCurrentStack(String stack, List<String> controlNames)
focal_class.identifier: evaluateCurrentStack
focal_class.modifiers: public static
focal_class.parameters: (String stack, List<String> controlNames)
focal_class.return: void
focal_class.signature: void evaluateCurrentStack(String stack, List<String> controlNames)
focal_method.body: public static void populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable) {
          if (expressionConfigurable == null || expressionConfigurable.getExpressionGraph() == null) {
              return;
          }
  
          // will hold graphs to populate the refreshExpressionGraph property on each expressionConfigurable
          // key is the path to the expressionConfigurable and value is the map of nested property names to expressions
          Map<String, Map<String, String>> refreshExpressionGraphs = new HashMap<String, Map<String, String>>();
  
          Map<String, String> expressionGraph = expressionConfigurable.getExpressionGraph();
          for (Map.Entry<String, String> expressionEntry : expressionGraph.entrySet()) {
              String propertyName = expressionEntry.getKey();
              String expression = expressionEntry.getValue();
  
              // by default assume expression belongs with passed in expressionConfigurable
              UifDictionaryBean configurableWithExpression = expressionConfigurable;
  
              // if property name is nested, we need to move the expression to the last expressionConfigurable
              String adjustedPropertyName = propertyName;
              if (StringUtils.contains(propertyName, ".")) {
                  String configurablePath = StringUtils.substringBeforeLast(propertyName, ".");
                  adjustedPropertyName = StringUtils.substringAfterLast(propertyName, ".");
  
                  Object nestedObject = ObjectPropertyUtils.getPropertyValue(expressionConfigurable, configurablePath);
  
                  // skip missing expression object for components skipping their lifecycle because objects
                  // in these components may be missing (and are expected to be missing)
                  if (nestedObject == null
                          && expressionConfigurable instanceof LifecycleElement
                          && ((LifecycleElement) expressionConfigurable).skipLifecycle()) {
                      continue;
                  }
  
                  if ((nestedObject == null) || !(nestedObject instanceof UifDictionaryBean)) {
                      throw new RiceRuntimeException("Object for which expression is configured on is null or does not "
                              + "implement UifDictionaryBean: '"
                              + configurablePath
                              + "' on class "
                              + expressionConfigurable.getClass().getName()
                              + " while evaluating "
                              + "expression for "
                              + propertyName);
                  }
  
                  // use nested object as the expressionConfigurable which will get the property expression
                  configurableWithExpression = (UifDictionaryBean) nestedObject;
              }
  
              configurableWithExpression.getPropertyExpressions().put(adjustedPropertyName, expression);
          }
      }
focal_method.class_method_signature: ExpressionUtils.populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable)
focal_method.full_signature: public static void populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable)
focal_method.identifier: populatePropertyExpressionsFromGraph
focal_method.invocations: getExpressionGraph getExpressionGraph entrySet getKey getValue contains substringBeforeLast substringAfterLast getPropertyValue skipLifecycle getName getClass put getPropertyExpressions
focal_method.modifiers: public static
focal_method.parameters: (UifDictionaryBean expressionConfigurable)
focal_method.return: void
focal_method.signature: void populatePropertyExpressionsFromGraph(UifDictionaryBean expressionConfigurable)