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

java.lang.Object
  extended by org.kuali.rice.krad.uif.util.ScriptUtils

public class ScriptUtils
extends Object

Utility class for generating JavaScript

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
ScriptUtils()
           
 
Method Summary
static String escapeName(String name)
          Escapes the ' character present in collection names so it can be properly used in js without causing javascript errors due to an early completion of a ' string.
static String translateValue(Object value)
          Translates an Object to a String for representing the given Object as a JavaScript value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptUtils

public ScriptUtils()
Method Detail

translateValue

public static String translateValue(Object value)
Translates an Object to a String for representing the given Object as a JavaScript value

Handles null, List, Map, and Set collections, along with non quoting for numeric and boolean types. Complex types are treated as a String value using toString

Parameters:
value - - Object instance to translate
Returns:
String JS value

escapeName

public static String escapeName(String name)
Escapes the ' character present in collection names so it can be properly used in js without causing javascript errors due to an early completion of a ' string.

Parameters:
name -
Returns:


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