test_class.file: rice-framework/krad-web-framework/src/test/java/org/kuali/rice/krad/uif/util/ScriptUtilsTest.java
test_class.identifier: ScriptUtilsTest
test_class.superclass: extends ProcessLoggingUnitTest
test_case.body: @Test
      /**
       * tests {@link ScriptUtils#convertToJsValue(String)} for  maps and arrays
       */
      public void testConvertToJSValue_mapAndArray() {
          assertEquals("array was not converted to js value as expected", " [-1, 4, 5] ", ScriptUtils.convertToJsValue(" [-1, 4, 5] "));
          String jsMap = " {'a':1, 'b':2} \n";
          assertEquals("map was not converted to js value as expected", jsMap, ScriptUtils.convertToJsValue(jsMap));
      }
test_case.class_method_signature: ScriptUtilsTest.testConvertToJSValue_mapAndArray()
test_case.full_signature: @Test /** * tests {@link ScriptUtils#convertToJsValue(String)} for maps and arrays */ public void testConvertToJSValue_mapAndArray()
test_case.identifier: testConvertToJSValue_mapAndArray
test_case.invocations: assertEquals convertToJsValue assertEquals convertToJsValue
test_case.modifiers: @Test /** * tests {@link ScriptUtils#convertToJsValue(String)} for maps and arrays */ public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testConvertToJSValue_mapAndArray()
focal_class.file: rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/uif/util/ScriptUtils.java
focal_class.identifier: ScriptUtils
focal_class.class_method_signature: ScriptUtils.translateValue(Object value)
focal_class.full_signature: public static String translateValue(Object value)
focal_class.identifier: translateValue
focal_class.modifiers: public static
focal_class.parameters: (Object value)
focal_class.return: String
focal_class.signature: String translateValue(Object value)
focal_class.class_method_signature: ScriptUtils.toJSON(Map<String, String> map)
focal_class.full_signature: public static String toJSON(Map<String, String> map)
focal_class.identifier: toJSON
focal_class.modifiers: public static
focal_class.parameters: (Map<String, String> map)
focal_class.return: String
focal_class.signature: String toJSON(Map<String, String> map)
focal_class.class_method_signature: ScriptUtils.escapeJSONString(String jsonString)
focal_class.full_signature: public static String escapeJSONString(String jsonString)
focal_class.identifier: escapeJSONString
focal_class.modifiers: public static
focal_class.parameters: (String jsonString)
focal_class.return: String
focal_class.signature: String escapeJSONString(String jsonString)
focal_class.class_method_signature: ScriptUtils.convertToJsValue(Map<String, String> stringMap)
focal_class.full_signature: public static String convertToJsValue(Map<String, String> stringMap)
focal_class.identifier: convertToJsValue
focal_class.modifiers: public static
focal_class.parameters: (Map<String, String> stringMap)
focal_class.return: String
focal_class.signature: String convertToJsValue(Map<String, String> stringMap)
focal_class.class_method_signature: ScriptUtils.convertToJsValue(String value)
focal_class.full_signature: public static String convertToJsValue(String value)
focal_class.identifier: convertToJsValue
focal_class.modifiers: public static
focal_class.parameters: (String value)
focal_class.return: String
focal_class.signature: String convertToJsValue(String value)
focal_class.class_method_signature: ScriptUtils.escapeName(String name)
focal_class.full_signature: public static String escapeName(String name)
focal_class.identifier: escapeName
focal_class.modifiers: public static
focal_class.parameters: (String name)
focal_class.return: String
focal_class.signature: String escapeName(String name)
focal_class.class_method_signature: ScriptUtils.convertStringListToJsArray(List<String> list)
focal_class.full_signature: public static String convertStringListToJsArray(List<String> list)
focal_class.identifier: convertStringListToJsArray
focal_class.modifiers: public static
focal_class.parameters: (List<String> list)
focal_class.return: String
focal_class.signature: String convertStringListToJsArray(List<String> list)
focal_class.class_method_signature: ScriptUtils.escapeHtml(String string)
focal_class.full_signature: public static String escapeHtml(String string)
focal_class.identifier: escapeHtml
focal_class.modifiers: public static
focal_class.parameters: (String string)
focal_class.return: String
focal_class.signature: String escapeHtml(String string)
focal_class.class_method_signature: ScriptUtils.escapeHtml(List<String> strings)
focal_class.full_signature: public static List<String> escapeHtml(List<String> strings)
focal_class.identifier: escapeHtml
focal_class.modifiers: public static
focal_class.parameters: (List<String> strings)
focal_class.return: List<String>
focal_class.signature: List<String> escapeHtml(List<String> strings)
focal_class.class_method_signature: ScriptUtils.appendScript(String script, String appendScript)
focal_class.full_signature: public static String appendScript(String script, String appendScript)
focal_class.identifier: appendScript
focal_class.modifiers: public static
focal_class.parameters: (String script, String appendScript)
focal_class.return: String
focal_class.signature: String appendScript(String script, String appendScript)
focal_class.class_method_signature: ScriptUtils.buildFunctionCall(String functionName, Object... arguments)
focal_class.full_signature: public static String buildFunctionCall(String functionName, Object... arguments)
focal_class.identifier: buildFunctionCall
focal_class.modifiers: public static
focal_class.parameters: (String functionName, Object... arguments)
focal_class.return: String
focal_class.signature: String buildFunctionCall(String functionName, Object... arguments)
focal_class.class_method_signature: ScriptUtils.buildEventHandlerScript(String id, String eventName, String eventScript)
focal_class.full_signature: public static String buildEventHandlerScript(String id, String eventName, String eventScript)
focal_class.identifier: buildEventHandlerScript
focal_class.modifiers: public static
focal_class.parameters: (String id, String eventName, String eventScript)
focal_class.return: String
focal_class.signature: String buildEventHandlerScript(String id, String eventName, String eventScript)
focal_method.body: public static String convertToJsValue(Map<String, String> stringMap) {
          if (stringMap == null || stringMap.isEmpty()) {
              return "{}";
          }
  
          String convertedValue = "{";
          for (String key : stringMap.keySet()) {
              convertedValue = convertedValue + "\"" + key + "\":" + convertToJsValue(stringMap.get(key)) + ",";
          }
  
          convertedValue = StringUtils.removeEnd(convertedValue, ",");
          convertedValue = convertedValue + "}";
  
          return convertedValue;
      }
focal_method.class_method_signature: ScriptUtils.convertToJsValue(Map<String, String> stringMap)
focal_method.full_signature: public static String convertToJsValue(Map<String, String> stringMap)
focal_method.identifier: convertToJsValue
focal_method.invocations: isEmpty keySet convertToJsValue get removeEnd
focal_method.modifiers: public static
focal_method.parameters: (Map<String, String> stringMap)
focal_method.return: String
focal_method.signature: String convertToJsValue(Map<String, String> stringMap)