SimpleJsonEncoder appendToJSON ( final String key , final Object value ) { if ( closed ) { throw new IllegalStateException ( "Encoder already closed" ) ; } if ( value != null ) { appendKey ( key ) ; if ( value instanceof Number ) { sb . append ( value . toString ( ) ) ; } else { sb . append ( QUOTE ) . append ( escapeString ( value . toString ( ) ) ) . append ( QUOTE ) ; } } return this ; }
Append field with quotes and escape characters added if required .