question: 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 ( ) ) ; }
target:  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.