public class JsonIo extends Object
Constructor and Description |
---|
JsonIo() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
deepCopy(Object o) |
static <T> T |
deepCopy(Object o,
ReadOptions readOptions,
WriteOptions writeOptions) |
static String |
formatJson(String json) |
static String |
formatJson(String json,
ReadOptions readOptions,
WriteOptions writeOptions) |
static void |
writeBasicString(Writer writer,
String s)
Writes out a string without special characters.
|
static void |
writeJsonUtf8Char(Writer writer,
char c) |
static void |
writeJsonUtf8String(Writer output,
String s)
Write out special characters "\b, \f, \t, \n, \r", as such, backslash as \\
quote as \" and values less than an ASCII space (20hex) as "\\u00xx" format,
characters in the range of ASCII space to a '~' as ASCII, and anything higher in UTF-8.
|
public static String formatJson(String json, ReadOptions readOptions, WriteOptions writeOptions)
public static <T> T deepCopy(Object o)
public static <T> T deepCopy(Object o, ReadOptions readOptions, WriteOptions writeOptions)
public static void writeBasicString(Writer writer, String s) throws IOException
writer
- Writer to which the UTF-8 string will be written tos
- String to be written in UTF-8 format on the output stream.IOException
- if an error occurs writing to the output stream.public static void writeJsonUtf8Char(Writer writer, char c) throws IOException
IOException
public static void writeJsonUtf8String(Writer output, String s) throws IOException
output
- Writer to which the UTF-8 string will be written tos
- String to be written in UTF-8 format on the output stream.IOException
- if an error occurs writing to the output stream.Copyright © 2023. All rights reserved.