(Appendable sb, Escaper escaper)
| 298 | } |
| 299 | |
| 300 | @Override |
| 301 | protected void toString(Appendable sb, Escaper escaper) throws IOException { |
| 302 | if (isString()) { |
| 303 | sb.append('"'); |
| 304 | sb.append(escaper.escapeJsonString(value.toString())); |
| 305 | sb.append('"'); |
| 306 | } else { |
| 307 | sb.append(value.toString()); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | private static boolean isPrimitiveOrString(Object target) { |
| 312 | if (target instanceof String) { |