org.objectweb.telosys.util
Class JsonUtil

java.lang.Object
  extended byorg.objectweb.telosys.util.JsonUtil

public final class JsonUtil
extends java.lang.Object


Method Summary
static java.lang.String value(boolean b)
           
static java.lang.String value(java.lang.Boolean v)
           
static java.lang.String value(byte v)
           
static java.lang.String value(java.util.Date date)
          There's no predefined format for Date objects in JSON
Here, just use a string in ISO format
static java.lang.String value(double v)
           
static java.lang.String value(float v)
           
static java.lang.String value(int v)
           
static java.lang.String value(long v)
           
static java.lang.String value(java.lang.Number v)
          JSON value for 'Number' instances (Byte, Short, Integer, Long, Float, Double, BigInteger, BigDecimal)
static java.lang.String value(short v)
           
static java.lang.String value(java.lang.String sStdString)
          Convert "Standard String" to "JSON String value"
A String value in JSON is just the string itself between quotes,
with special characters protection ( \x )
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

value

public static java.lang.String value(java.lang.String sStdString)
Convert "Standard String" to "JSON String value"
A String value in JSON is just the string itself between quotes,
with special characters protection ( \x )

Parameters:
sStdString - :
Returns:
String :

value

public static java.lang.String value(java.util.Date date)
There's no predefined format for Date objects in JSON
Here, just use a string in ISO format

Parameters:
date -
Returns:

value

public static java.lang.String value(boolean b)
Parameters:
b -
Returns:
"true" or "false"

value

public static java.lang.String value(java.lang.Boolean v)

value

public static java.lang.String value(java.lang.Number v)
JSON value for 'Number' instances (Byte, Short, Integer, Long, Float, Double, BigInteger, BigDecimal)

Parameters:
v -
Returns:
the value as is ( without quotes ) or "null" if null

value

public static java.lang.String value(byte v)

value

public static java.lang.String value(short v)

value

public static java.lang.String value(int v)

value

public static java.lang.String value(long v)

value

public static java.lang.String value(float v)

value

public static java.lang.String value(double v)