org.odlabs.wiquery.core.javascript
Class JsUtils

java.lang.Object
  extended by org.odlabs.wiquery.core.javascript.JsUtils

public class JsUtils
extends Object

$Id$

Helper class to ease JavaScript integration.

Since:
0.7
Author:
Lionel Armanet

Constructor Summary
JsUtils()
           
 
Method Summary
static CharSequence array(CharSequence... args)
           
static String doubleQuotes(CharSequence stringToDoubleQuote)
          Double quotes the given string (eg.
static String doubleQuotes(CharSequence stringToDoubleQuote, boolean escapeDoubleQuote)
          Double quotes the given string (eg.
static String escapeDoubleQuote(CharSequence stringToDoubleQuote)
           
static String escapeQuote(CharSequence stringToQuote)
           
static String implode(EventLabel... eventLabels)
          Converts the given array of EventLabel to a String.
static String quotes(CharSequence stringToQuote)
          Quotes the given string (eg.
static String quotes(CharSequence stringToQuote, boolean escapeQuote)
          Quotes the given string (eg.
static String string(int value)
          Converts an int to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsUtils

public JsUtils()
Method Detail

array

public static CharSequence array(CharSequence... args)
Returns:
a javascript representation of the array

doubleQuotes

public static String doubleQuotes(CharSequence stringToDoubleQuote)
Double quotes the given string (eg. makes a JavaScript String).


doubleQuotes

public static String doubleQuotes(CharSequence stringToDoubleQuote,
                                  boolean escapeDoubleQuote)
Double quotes the given string (eg. makes a JavaScript String).


escapeDoubleQuote

public static String escapeDoubleQuote(CharSequence stringToDoubleQuote)
Returns:
the sequence with escaped double quotes

escapeQuote

public static String escapeQuote(CharSequence stringToQuote)
Returns:
the sequence with escaped quotes

implode

public static String implode(EventLabel... eventLabels)
Converts the given array of EventLabel to a String.


quotes

public static String quotes(CharSequence stringToQuote)
Quotes the given string (eg. makes a JavaScript String).


quotes

public static String quotes(CharSequence stringToQuote,
                            boolean escapeQuote)
Quotes the given string (eg. makes a JavaScript String).


string

public static String string(int value)
Converts an int to a String. (common alias of valueOf).



Copyright © 2012. All Rights Reserved.