static String valueToString(Object value,int indentFactor,int indent){
  if (value == null || value.equals(null)) {
    return "null";
  }
  try {
    if (value instanceof String) {
      return quote((String)value);
    }
  }
 catch (  Exception e) {
  }
  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) {
    return value.toString();
  }
  if (value instanceof Map) {
    return print((Map)value,indentFactor,indent);
  }
  if (value instanceof List) {
    return print((List)value,indentFactor,indent);
  }
  return quote(value.toString());
}

static String valueToString ( Object value , int indentFactor , int indent ) { if ( value == null || value . equals ( null ) ) { return "null" ; } try { if ( value instanceof String ) { return quote ( ( String ) value ) ; } } catch ( Exception e ) { } 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 ) { return value . toString ( ) ; } if ( value instanceof Map ) { return print ( ( Map ) value , indentFactor , indent ) ; } if ( value instanceof List ) { return print ( ( List ) value , indentFactor , indent ) ; } return quote ( value . toString ( ) ) ; }
make a prettyprinted json text of an object value . < p > warning : this method assumes that the data structure is acyclical .
