static String valueToString(Object value){
  if (value == null || value.equals(null)) {
    return "null";
  }
  if (value instanceof String) {
    return (String)value;
  }
  if (value instanceof Float || value instanceof Double || value instanceof Byte|| value instanceof Short|| value instanceof Integer|| value instanceof Long) {
    return numberToString(value);
  }
  if (value instanceof Boolean || value instanceof Map || value instanceof List) {
    return value.toString();
  }
  return quote(value.toString());
}

static String valueToString ( Object value ) { if ( value == null || value . equals ( null ) ) { return "null" ; } if ( value instanceof String ) { return ( String ) value ; } if ( value instanceof Float || value instanceof Double || value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long ) { return numberToString ( value ) ; } if ( value instanceof Boolean || value instanceof Map || value instanceof List ) { return value . toString ( ) ; } return quote ( value . toString ( ) ) ; }
make a json text of an object value . if the object has an value . tojsonstring ( ) method , then that method will be used to produce the json text . the method is required to produce a strictly conforming text . if the object does not contain a tojsonstring method ( which is the most common case ) , then a text will be produced by the rules . < p > warning : this method assumes that the data structure is acyclical .
