Package com.alibaba.fastjson2
Interface JSON
public interface JSON
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfig(JSONReader.Feature... features) Enable the specified features in default readerstatic voidconfig(JSONReader.Feature feature, boolean state) Enable or disable the specified features in default readerstatic voidconfig(JSONWriter.Feature... features) Enable the specified features in default writerstatic voidconfig(JSONWriter.Feature feature, boolean state) Enable or disable the specified features in default writerstatic voidconfigReaderDateFormat(String dateFormat) config default reader dateFormatstatic voidconfigReaderZoneId(ZoneId zoneId) config default reader zoneIdstatic voidconfigWriterDateFormat(String dateFormat) config default reader dateFormatstatic voidconfigWriterZoneId(ZoneId zoneId) config default writer zoneIdstatic <T> Tcopy(T object, JSONWriter.Feature... features) Builds a newJSONusing the properties of the specified objectstatic <T> TcopyTo(Object object, Class<T> targetClass, JSONWriter.Feature... features) Builds a new instance of targetClass using the properties of the specified objectstatic booleanisEnabled(JSONReader.Feature feature) Check if the default reader enables the specified featurestatic booleanisEnabled(JSONWriter.Feature feature) Check if the default writer enables the specified featurestatic booleanisValid(byte[] bytes) Verify that the json byte array is legal json textstatic booleanVerify that the json byte array is legal json textstatic booleanVerify that the json byte array is legal json textstatic booleanisValid(char[] chars) Verify that the json char array is legal json textstatic booleanVerify that the json string is legal json textstatic booleanisValid(String text, JSONReader.Feature... features) Verify that the json string is legal json textstatic booleanisValidArray(byte[] bytes) Verify that the json byte array is a legal JsonArraystatic booleanisValidArray(String text) Verify theStringis JSON Arraystatic booleanisValidObject(byte[] bytes) Verify that the json byte array is a legal JsonObjectstatic booleanisValidObject(String text) Verify that the json string is a legal JsonObjectstatic voidstatic Objectparse(byte[] bytes, int offset, int length, Charset charset, JSONReader.Context context) Parses the json byte array as aJSONArrayorJSONObject.static Objectparse(byte[] bytes, JSONReader.Context context) Parses the json byte array as aJSONArrayorJSONObject.static Objectparse(byte[] bytes, JSONReader.Feature... features) Parses the json byte array as aJSONArrayorJSONObject.static Objectparse(char[] chars, JSONReader.Context context) Parses the json char array as aJSONArrayorJSONObject.static Objectparse(char[] chars, JSONReader.Feature... features) Parses the json char array as aJSONArrayorJSONObject.static Objectparse(InputStream in, JSONReader.Context context) Parses the json stream as aJSONArrayorJSONObject.static ObjectParses the json string as aJSONArrayorJSONObject.static Objectparse(String text, int offset, int length, JSONReader.Feature... features) Parses the json string as aJSONArrayorJSONObject.static Objectparse(String text, JSONReader.Context context) Parses the json string as aJSONArrayorJSONObject.static Objectparse(String text, JSONReader.Feature... features) Parses the json string as aJSONArrayorJSONObject.static JSONArrayparseArray(byte[] bytes) Parses the json byte array as aJSONArray.static JSONArrayparseArray(byte[] bytes, int offset, int length, Charset charset) Parses the json byte array as aJSONArray.static <T> List<T>parseArray(byte[] bytes, int offset, int length, Charset charset, Class<T> type, JSONReader.Feature... features) Parses the json byte array as a list ofJSON.static <T> List<T>parseArray(byte[] bytes, Class<T> type, JSONReader.Feature... features) Parses the json byte array as a list ofJSON.static <T> List<T>parseArray(byte[] bytes, Type type, JSONReader.Feature... features) Parses the json byte array as a list ofJSON.static JSONArrayparseArray(char[] chars) Parses the json char array as aJSONArray.static <T> List<T>parseArray(char[] chars, Class<T> type, JSONReader.Feature... features) Parses the json char array as a list ofJSON.static JSONArrayparseArray(InputStream in, JSONReader.Feature... features) Parses the json stream as aJSONArray.static JSONArrayparseArray(InputStream in, Charset charset, JSONReader.Context context) Parses the json stream as aJSONArray.static JSONArrayparseArray(String text) Parses the json string as aJSONArray.static JSONArrayparseArray(String text, JSONReader.Feature... features) Parses the json string as aJSONArray.static <T> List<T>parseArray(String text, Class<T> type) Parses the json string as a list ofJSON.static <T> List<T>parseArray(String text, Class<T> type, JSONReader.Feature... features) Parses the json string as a list ofJSON.static <T> List<T>parseArray(String text, Type type) Parses the json string as a list ofJSON.static <T> List<T>parseArray(String text, Type... types) Parses the json string as a list ofJSON.static <T> List<T>parseArray(String text, Type[] types, JSONReader.Feature... features) Parses the json string as a list ofJSON.static <T> List<T>parseArray(String text, Type type, JSONReader.Feature... features) Parses the json string as a list ofJSON.static JSONArrayparseArray(URL url, JSONReader.Feature... features) Parses the json stream of the url as aJSONArray.static JSONObjectparseObject(byte[] bytes) Parses the json byte array as aJSONObject.static JSONObjectparseObject(byte[] bytes, int offset, int length, JSONReader.Feature... features) Parses the json byte array as aJSONObject.static <T> TparseObject(byte[] bytes, int offset, int length, Type type, JSONReader.Feature... features) Parses the json byte array asJSON.static JSONObjectparseObject(byte[] bytes, int offset, int length, Charset charset, JSONReader.Feature... features) Parses the json byte array as aJSONObject.static <T> TparseObject(byte[] bytes, int offset, int length, Charset charset, Class<T> type) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, int offset, int length, Charset charset, Class<T> type, JSONReader.Feature... features) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, int offset, int length, Charset charset, Type type) Parses the json byte array asJSON.static JSONObjectparseObject(byte[] bytes, JSONReader.Feature... features) Parses the json byte array as aJSONObject.static <T> TparseObject(byte[] bytes, Class<T> clazz) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, Class<T> clazz, Filter filter, JSONReader.Feature... features) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, Class<T> clazz, JSONReader.Context context) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, Class<T> clazz, JSONReader.Feature... features) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, Type type) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, Type type, Filter filter, JSONReader.Feature... features) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, Type type, JSONReader.Feature... features) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, Type type, String format, Filter[] filters, JSONReader.Feature... features) Parses the json byte array asJSON.static <T> TparseObject(byte[] bytes, Type type, String format, JSONReader.Feature... features) Parses the json byte array asJSON.static JSONObjectparseObject(char[] chars) Parses the json char array as aJSONObject.static JSONObjectparseObject(char[] chars, int offset, int length, JSONReader.Feature... features) Parses the json chars array as aJSONObject.static <T> TparseObject(char[] chars, int offset, int length, Type type, JSONReader.Feature... features) Parses the json char array asJSON.static <T> TparseObject(char[] chars, Class<T> clazz) Parses the json char array asJSON.static <T> TparseObject(char[] chars, Class<T> objectClass, JSONReader.Feature... features) Parses the json byte array asJSON.static <T> TparseObject(char[] chars, Type type, JSONReader.Feature... features) Parses the json byte array asJSON.static JSONObjectparseObject(InputStream input, JSONReader.Feature... features) Parses the json stream as aJSONObject.static <T> TparseObject(InputStream input, Type type, JSONReader.Feature... features) Parses the json stream as aJSON.static <T> TparseObject(InputStream input, Type type, String format, JSONReader.Feature... features) Parses the json stream as aJSON.static <T> voidparseObject(InputStream input, Type type, Consumer<T> consumer, JSONReader.Feature... features) Parses the json stream through the specified delimiter asJSONobjects and call the specified consumer to consume itstatic JSONObjectparseObject(InputStream in, Charset charset) Parses the json stream as aJSONObject.static <T> voidparseObject(InputStream input, Charset charset, char delimiter, Type type, Consumer<T> consumer, JSONReader.Feature... features) Parses the json stream through the specified delimiter asJSONobjects and call the specified consumer to consume itstatic JSONObjectparseObject(InputStream input, Charset charset, JSONReader.Context context) Parses the json stream as aJSONObject.static <T> TparseObject(InputStream input, Charset charset, Class<T> type, JSONReader.Context context) Parses the json stream as aJSON.static <T> TparseObject(InputStream input, Charset charset, Type type, JSONReader.Context context) Parses the json stream as aJSON.static <T> TparseObject(InputStream input, Charset charset, Type type, JSONReader.Feature... features) Parses the json stream as aJSON.static <T> voidparseObject(Reader input, char delimiter, Type type, Consumer<T> consumer) Parses the json reader through the specified delimiter asJSONobjects and call the specified consumer to consume itstatic JSONObjectparseObject(Reader input, JSONReader.Feature... features) Parses the json reader as aJSONObject.static <T> TparseObject(Reader input, Type type, JSONReader.Feature... features) Parses the json reader as aJSON.static JSONObjectparseObject(String text) Parses the json string as aJSONObject.static JSONObjectparseObject(String text, int offset, int length, JSONReader.Context context) Parses the json string as aJSONObject.static JSONObjectparseObject(String text, int offset, int length, JSONReader.Feature... features) Parses the json string as aJSONObject.static <T> TparseObject(String text, int offset, int length, Class<T> clazz, JSONReader.Feature... features) Parses the json string asJSON.static JSONObjectparseObject(String text, JSONReader.Context context) Parses the json string as aJSONObject.static JSONObjectparseObject(String text, JSONReader.Feature... features) Parses the json string as aJSONObject.static <T> TparseObject(String text, TypeReference<T> typeReference, Filter filter, JSONReader.Feature... features) Parses the json string asJSON.static <T> TparseObject(String text, TypeReference<T> typeReference, JSONReader.Feature... features) Parses the json string asJSON.parseObject(String text, MapMultiValueType<T> type) Parses the json string asJSON.static <T> TparseObject(String text, Class<T> clazz) Parses the json string asJSON.static <T> TparseObject(String text, Class<T> clazz, Filter filter, JSONReader.Feature... features) Parses the json string asJSON.static <T> TparseObject(String text, Class<T> clazz, JSONReader.Context context) Parses the json string asJSON.static <T> TparseObject(String text, Class<T> clazz, JSONReader.Feature... features) Parses the json string asJSON.static <T> TparseObject(String text, Class<T> clazz, String format, JSONReader.Feature... features) Parses the json string asJSON.static <T> TparseObject(String text, Type type) Parses the json string asJSON.static <T> TparseObject(String text, Type... types) Parses the json string asJSON.static <T> TparseObject(String text, Type type, Filter filter, JSONReader.Feature... features) Parses the json string asJSON.static <T> TparseObject(String text, Type type, JSONReader.Feature... features) Parses the json string asJSON.static <T> TparseObject(String text, Type type, String format, Filter[] filters, JSONReader.Feature... features) Parses the json string asJSON.static <T> TparseObject(String text, Type type, String format, JSONReader.Feature... features) Parses the json string asJSON.static JSONObjectparseObject(URL url) Parses the json stream of the url as aJSONObject.static <T> TparseObject(URL url, Class<T> objectClass, JSONReader.Feature... features) Parses the json stream of the url asJSON.static <T> TparseObject(URL url, Type type, JSONReader.Feature... features) Parses the json stream of the url asJSON.static <T> TparseObject(URL url, Function<JSONObject, T> function, JSONReader.Feature... features) Parses the json stream of the url as aJSONObjectand call the function to convert it toJSON.static <T> TparseObject(ByteBuffer buffer, Class<T> objectClass) Parses the json byte buffer as aJSON.static booleanregister(ObjectReaderModule objectReaderModule) Register anObjectReaderModulein defaultObjectReaderProviderstatic booleanregister(ObjectWriterModule objectWriterModule) Register anObjectWriterModulein defaultObjectWriterProviderstatic voidRegister ObjectWriterFilterstatic ObjectReader<?>register(Type type, ObjectReader<?> objectReader) static ObjectReader<?>register(Type type, ObjectReader<?> objectReader, boolean fieldBased) static ObjectWriter<?>register(Type type, ObjectWriter<?> objectWriter) static ObjectWriter<?>register(Type type, ObjectWriter<?> objectWriter, boolean fieldBased) static ObjectReader<?>registerIfAbsent(Type type, ObjectReader<?> objectReader) static ObjectReader<?>registerIfAbsent(Type type, ObjectReader<?> objectReader, boolean fieldBased) static ObjectWriter<?>registerIfAbsent(Type type, ObjectWriter<?> objectWriter) static ObjectWriter<?>registerIfAbsent(Type type, ObjectWriter<?> objectWriter, boolean fieldBased) static voidregisterSeeAlsoSubType(Class subTypeClass) static voidregisterSeeAlsoSubType(Class subTypeClass, String subTypeClassName) static <T> TConverts the specified object to an object of the specified goal typestatic <T> TtoJavaObject(Object object, Class<T> clazz) Deprecated.static ObjectConverts the specified object to aJSONArrayorJSONObject.static ObjecttoJSON(Object object, JSONWriter.Feature... features) Converts the specified object to aJSONArrayorJSONObject.static byte[]toJSONBytes(Object object) Serializes the specified object to the json byte arraystatic byte[]toJSONBytes(Object object, Filter... filters) Serializes the specified object to the json byte arraystatic byte[]toJSONBytes(Object object, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json byte arraystatic byte[]toJSONBytes(Object object, JSONWriter.Feature... features) Serializes the specified object to the json byte arraystatic byte[]toJSONBytes(Object object, String format, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json byte arraystatic byte[]toJSONBytes(Object object, String format, JSONWriter.Feature... features) Serializes the specified object to the json byte arraystatic byte[]toJSONBytes(Object object, Charset charset, JSONWriter.Context context) Serializes the specified object to the json byte arraystatic byte[]toJSONBytes(Object object, Charset charset, JSONWriter.Feature... features) Serializes the specified object to the json byte arraystatic StringtoJSONString(Object object) Serializes the specified object to the json stringstatic StringtoJSONString(Object object, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json stringstatic StringtoJSONString(Object object, Filter filter, JSONWriter.Feature... features) Serializes the specified object to the json stringstatic StringtoJSONString(Object object, JSONWriter.Context context) Serializes the specified object to the json stringstatic StringtoJSONString(Object object, JSONWriter.Feature... features) Serializes the specified object to the json stringstatic StringtoJSONString(Object object, String format, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json stringstatic StringtoJSONString(Object object, String format, JSONWriter.Feature... features) Serializes the specified object to the json stringstatic intwriteTo(OutputStream out, Object object) Serializes the specified object to the json byte array and write it toOutputStreamstatic intwriteTo(OutputStream out, Object object, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json byte array and write it toOutputStreamstatic intwriteTo(OutputStream out, Object object, JSONWriter.Context context) Serializes the specified object to the json byte array and write it toOutputStreamstatic intwriteTo(OutputStream out, Object object, JSONWriter.Feature... features) Serializes the specified object to the json byte array and write it toOutputStreamstatic intwriteTo(OutputStream out, Object object, String format, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json byte array and write it toOutputStream
-
Field Details
-
VERSION
fastjson2 version name- See Also:
-
-
Method Details
-
parse
Parses the json string as aJSONArrayorJSONObject. Returnsnullif receivedStringisnullor empty.- Parameters:
text- the specified text to be parsed- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occurs
-
parse
Parses the json string as aJSONArrayorJSONObject. Returnsnullif receivedStringisnullor empty.- Parameters:
text- the specified text to be parsedfeatures- the specified features is applied to parsing- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occurs
-
parse
Parses the json string as aJSONArrayorJSONObject. Returnsnullif receivedStringisnullor empty or length is 0.- Parameters:
text- the specified text to be parsedoffset- the starting index of stringlength- the specified length of stringfeatures- the specified features is applied to parsing- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occurs
-
parse
Parses the json string as aJSONArrayorJSONObject. Returnsnullif receivedStringisnullor empty.- Parameters:
text- the specified text to be parsedcontext- the specified custom context- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occursNullPointerException- If received context is null
-
parse
Parses the json byte array as aJSONArrayorJSONObject. Returnsnullif received byte array isnullor empty.- Parameters:
bytes- the specified UTF8 text to be parsedfeatures- the specified features is applied to parsing- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occurs
-
parse
Parses the json byte array as aJSONArrayorJSONObject. Returnsnullif received byte array isnullor empty.- Parameters:
bytes- the specified UTF8 text to be parsedcontext- the specified custom context- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occurs- Since:
- 2.0.51
-
parse
static Object parse(byte[] bytes, int offset, int length, Charset charset, JSONReader.Context context) Parses the json byte array as aJSONArrayorJSONObject. Returnsnullif received byte array isnullor empty.- Parameters:
bytes- the specified UTF8 text to be parsedcontext- the specified custom context- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occurs- Since:
- 2.0.51
-
parse
Parses the json char array as aJSONArrayorJSONObject. Returnsnullif received char array isnullor empty.- Parameters:
chars- the specified char array to be parsedfeatures- the specified features is applied to parsing- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occurs
-
parse
Parses the json char array as aJSONArrayorJSONObject. Returnsnullif received char array isnullor empty.- Parameters:
chars- the specified char array to be parsedcontext- the specified custom context- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occurs- Since:
- 2.0.51
-
parse
Parses the json stream as aJSONArrayorJSONObject. Returnsnullif receivedStringisnullor empty.- Parameters:
in- the specified stream to be parsedcontext- the specified custom context- Returns:
- either
JSONArrayorJSONObjector null - Throws:
JSONException- If a parsing error occursNullPointerException- If received context is null- Since:
- 2.0.47
-
parseObject
Parses the json string as aJSONObject. Returnsnullif receivedStringisnullor empty or its content is null.- Parameters:
text- the specified string to be parsed- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json string as aJSONObject. Returnsnullif receivedStringisnullor empty or its content is null.- Parameters:
text- the specified string to be parsedfeatures- the specified features is applied to parsing- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json string as aJSONObject. Returnsnullif receivedStringisnullor empty or length is 0 or its content is null.- Parameters:
text- the specified text to be parsedoffset- the starting index of stringlength- the specified length of stringfeatures- the specified features is applied to parsing- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json string as aJSONObject. Returnsnullif receivedStringisnullor empty or length is 0 or its content is null.- Parameters:
text- the specified text to be parsedoffset- the starting index of stringlength- the specified length of stringcontext- the specified custom context- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occursNullPointerException- If received context is null- Since:
- 2.0.30
-
parseObject
Parses the json string as aJSONObject. Returnsnullif receivedStringisnullor empty or its content is null.- Parameters:
text- the specified string to be parsedcontext- the specified custom context- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occursNullPointerException- If received context is null
-
parseObject
Parses the json reader as aJSONObject. Returnsnullif receivedReaderisnullor its content is null.- Parameters:
input- the specified reader to be parsedfeatures- the specified features is applied to parsing- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json stream as aJSONObject. Returnsnullif receivedInputStreamisnullor closed or its content is null.- Parameters:
input- the specified stream to be parsedfeatures- the specified features is applied to parsing- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json byte array as aJSONObject. Returnsnullif received byte array isnullor empty or its content is null.- Parameters:
bytes- the specified UTF8 text to be parsed- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json char array as aJSONObject. Returnsnullif received char array isnullor empty or its content is null.- Parameters:
chars- the specified char array to be parsed- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json stream as aJSONObject. Returnsnullif receivedInputStreamisnullor its content is null.- Parameters:
in- the specified stream to be parsedcharset- the specified charset of the stream- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json stream as aJSONObject. Returnsnullif receivedInputStreamisnullor closed or its content is null.- Parameters:
input- the specified stream to be parsedcharset- the specified charset of the streamcontext- the specified custom context- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs- Since:
- 2.0.47
-
parseObject
- Parameters:
url- the specified url to be parsed- Returns:
JSONObjectornull- Throws:
JSONException- If an I/O error or parsing error occurs- See Also:
-
parseObject
Parses the json byte array as aJSONObject. Returnsnullif received byte array isnullor empty or its content is null.- Parameters:
bytes- the specified UTF8 text to be parsedfeatures- the specified features is applied to parsing- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json byte array as aJSONObject. Returnsnullif received byte array isnullor empty or length is 0 or its content is null.- Parameters:
bytes- the specified UTF8 text to be parsedoffset- the starting index of arraylength- the specified length of arrayfeatures- the specified features is applied to parsing- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json chars array as aJSONObject. Returnsnullif received chars array isnullor empty or length is 0 or its content is null.- Parameters:
chars- the specified chars array to be parsedoffset- the starting index of arraylength- the specified length of arrayfeatures- the specified features is applied to parsing- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static JSONObject parseObject(byte[] bytes, int offset, int length, Charset charset, JSONReader.Feature... features) Parses the json byte array as aJSONObject. Returnsnullif received byte array isnullor empty or length is 0 or its content is null.- Parameters:
bytes- the specified UTF8 text to be parsedoffset- the starting index of arraylength- the specified length of arraycharset- the specified charset of the streamfeatures- the specified features is applied to parsing- Returns:
JSONObjectornull- Throws:
JSONException- If a parsing error occurs- See Also:
-
parseObject
- Parameters:
text- the specified string to be parsedclazz- the specified class ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(String text, Class<T> clazz, Filter filter, JSONReader.Feature... features) Parses the json string asJSON. Returnsnullif receivedStringisnullor empty or its content is null.- Parameters:
text- the specified string to be parsedclazz- the specified class ofJSONfilter- the specified filter is applied to parsingfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(String text, Type type, String format, Filter[] filters, JSONReader.Feature... features) Parses the json string asJSON. Returnsnullif receivedStringisnullor empty or its content is null.- Parameters:
text- the specified string to be parsedtype- the specified actual type ofJSONformat- the specified date formatfilters- the specified filters is applied to parsingfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
text- the specified string to be parsedtype- the specified actual type ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
text- the specified string to be parsedtype- the specified actual type ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs- Since:
- 2.0.34
-
parseObject
- Parameters:
text- the specified string to be parsedtypes- the specified actual parameter types- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs- See Also:
-
parseObject
static <T> T parseObject(String text, TypeReference<T> typeReference, JSONReader.Feature... features) - Parameters:
text- the specified string to be parsedtypeReference- the specified actual typefeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(String text, TypeReference<T> typeReference, Filter filter, JSONReader.Feature... features) - Parameters:
text- the specified string to be parsedtypeReference- the specified actual typefilter- the specified filter is applied to parsingfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
text- the specified string to be parsedclazz- the specified class ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(String text, int offset, int length, Class<T> clazz, JSONReader.Feature... features) - Parameters:
text- the specified string to be parsedoffset- the starting index of stringlength- the specified length of stringclazz- the specified class ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
text- the specified string to be parsedclazz- the specified class ofJSONcontext- the specified custom context- Returns:
JSONornull- Throws:
JSONException- If a parsing error occursNullPointerException- If received context is null
-
parseObject
static <T> T parseObject(String text, Class<T> clazz, String format, JSONReader.Feature... features) - Parameters:
text- the specified string to be parsedclazz- the specified class ofJSONformat- the specified date formatfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
text- the specified string to be parsedtype- the specified actual typefeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
text- the specified string to be parsedtype- the specified actual typefilter- the specified filter is applied to parsingfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
text- the specified string to be parsedtype- the specified actual typeformat- the specified date formatfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(char[] chars, int offset, int length, Type type, JSONReader.Feature... features) Parses the json char array asJSON. Returnsnullif received char array isnullor empty or length is 0.- Parameters:
chars- the specified char array to be parsedtype- the specified actual typeoffset- the starting index of arraylength- the specified length of arrayfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs- Since:
- 2.0.13
-
parseObject
- Parameters:
chars- the specified char array to be parsedclazz- the specified class ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(byte[] bytes, int offset, int length, Type type, JSONReader.Feature... features) Parses the json byte array asJSON. Returnsnullif received byte array isnullor empty or length is 0.- Parameters:
bytes- the specified UTF8 text to be parsedoffset- the starting index of arraylength- the specified length of arraytype- the specified actual typefeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs- Since:
- 2.0.13
-
parseObject
- Parameters:
bytes- the specified UTF8 text to be parsedtype- the specified actual type ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
bytes- the specified UTF8 text to be parsedclazz- the specified class ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(byte[] bytes, Class<T> clazz, Filter filter, JSONReader.Feature... features) - Parameters:
bytes- the specified UTF8 text to be parsedclazz- the specified class ofJSONfilter- the specified filter is applied to parsingfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
bytes- the specified UTF8 text to be parsedclazz- the specified class ofJSONcontext- the specified custom context- Returns:
JSONornull- Throws:
JSONException- If a parsing error occursNullPointerException- If received context is null
-
parseObject
static <T> T parseObject(byte[] bytes, Type type, String format, Filter[] filters, JSONReader.Feature... features) - Parameters:
bytes- the specified UTF8 text to be parsedtype- the specified actual typeformat- the specified date formatfilters- the specified filters is applied to parsingfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
bytes- the specified UTF8 text to be parsedclazz- the specified class ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
bytes- the specified UTF8 text to be parsedtype- the specified actual type ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
chars- the specified charsobjectClass- the specified actual type ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
chars- the specified charstype- the specified actual type ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
bytes- the specified UTF8 text to be parsedtype- the specified actual type ofJSONfilter- the specified filter is applied to parsingfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
bytes- the specified UTF8 text to be parsedtype- the specified actual type ofJSONformat- the specified date formatfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
buffer- the specified buffer to be parsedobjectClass- the specified class ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
input- the specified reader to be parsedtype- the specified actual type ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json stream as aJSON. Returnsnullif receivedInputStreamisnullor its content is null.- Parameters:
input- the specified stream to be parsedtype- the specified actual type ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json stream as aJSON. Returnsnullif receivedInputStreamisnullor its content is null.- Parameters:
input- the specified stream to be parsedtype- the specified actual type ofJSONcontext- the specified custom context- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(InputStream input, Charset charset, Class<T> type, JSONReader.Context context) Parses the json stream as aJSON. Returnsnullif receivedInputStreamisnullor its content is null.- Parameters:
input- the specified stream to be parsedtype- the specified actual type ofJSONcontext- the specified custom context- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
- Parameters:
url- the specified url to be parsedtype- the specified actual type ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If an I/O error or parsing error occurs- Since:
- 2.0.4
- See Also:
-
parseObject
- Parameters:
url- the specified url to be parsedobjectClass- the specified class ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If an I/O error or parsing error occurs- Since:
- 2.0.9
- See Also:
-
parseObject
Parses the json stream of the url as aJSONObjectand call the function to convert it toJSON. Returnsnullif receivedURLisnull.- Parameters:
url- the specified url to be parsedfunction- the specified converterfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If an I/O error or parsing error occurs- Since:
- 2.0.4
- See Also:
-
parseObject
static <T> T parseObject(InputStream input, Type type, String format, JSONReader.Feature... features) Parses the json stream as aJSON. Returnsnullif receivedInputStreamisnullor its content is null.- Parameters:
input- the specified stream to be parsedtype- the specified actual type ofJSONformat- the specified date formatfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(InputStream input, Charset charset, Type type, JSONReader.Feature... features) Parses the json stream as aJSON. Returnsnullif receivedInputStreamisnullor its content is null.- Parameters:
input- the specified stream to be parsedcharset- the specified charset of the streamtype- the specified actual type ofJSONfeatures- the specified features is applied to parsing- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json byte array asJSON. Returnsnullif received byte array isnullor empty or length is 0.- Parameters:
bytes- the specified UTF8 text to be parsedoffset- the starting index of arraylength- the specified length of arraycharset- the specified charset of the streamtype- the specified actual type ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
Parses the json byte array asJSON. Returnsnullif received byte array isnullor empty or length is 0.- Parameters:
bytes- the specified UTF8 text to be parsedoffset- the starting index of arraylength- the specified length of arraycharset- the specified charset of the streamtype- the specified actual type ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> T parseObject(byte[] bytes, int offset, int length, Charset charset, Class<T> type, JSONReader.Feature... features) Parses the json byte array asJSON. Returnsnullif received byte array isnullor empty or length is 0.- Parameters:
bytes- the specified UTF8 text to be parsedoffset- the starting index of arraylength- the specified length of arraycharset- the specified charset of the streamtype- the specified actual class ofJSON- Returns:
JSONornull- Throws:
JSONException- If a parsing error occurs
-
parseObject
static <T> void parseObject(InputStream input, Type type, Consumer<T> consumer, JSONReader.Feature... features) Parses the json stream through the specified delimiter asJSONobjects and call the specified consumer to consume it- Parameters:
input- the specified stream to be parsedtype- the specified actual class ofJSONconsumer- the specified consumer is called multiple timesfeatures- the specified features is applied to parsing- Throws:
JSONException- If an I/O error or parsing error occursNullPointerException- If the specified stream is null- Since:
- 2.0.2
-
parseObject
static <T> void parseObject(InputStream input, Charset charset, char delimiter, Type type, Consumer<T> consumer, JSONReader.Feature... features) Parses the json stream through the specified delimiter asJSONobjects and call the specified consumer to consume it- Parameters:
input- the specified stream to be parsedcharset- the specified charset of the streamtype- the specified actual class ofJSONdelimiter- the specified delimiter for the streamconsumer- the specified consumer is called multiple timesfeatures- the specified features is applied to parsing- Throws:
JSONException- If an I/O error or parsing error occursNullPointerException- If the specified stream is null- Since:
- 2.0.2
-
parseObject
Parses the json reader through the specified delimiter asJSONobjects and call the specified consumer to consume it- Parameters:
input- the specified reader to be parsedtype- the specified actual class ofJSONdelimiter- the specified delimiter for the streamconsumer- the specified consumer is called multiple times- Throws:
JSONException- If an I/O error or parsing error occursNullPointerException- If the specified reader is null- Since:
- 2.0.2
-
parseArray
Parses the json string as aJSONArray. Returnsnullif receivedStringisnullor empty or its content is null.- Parameters:
text- the specified string to be parsed- Returns:
JSONArrayornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
Parses the json byte array as aJSONArray. Returnsnullif received byte array isnullor empty or its content is null.- Parameters:
bytes- the specified UTF8 text to be parsed- Returns:
JSONArrayornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
Parses the json byte array as aJSONArray. Returnsnullif received byte array isnullor empty or length is 0 or its content is null.- Parameters:
bytes- the specified byte array to be parsedoffset- the starting index of arraylength- the specified length of arraycharset- the specified charset of the stream- Throws:
JSONException- If a parsing error occurs- Since:
- 2.0.13
-
parseArray
Parses the json char array as aJSONArray. Returnsnullif received byte array isnullor empty or its content is null.- Parameters:
chars- the specified char array to be parsed- Returns:
JSONArrayornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
Parses the json string as aJSONArray. Returnsnullif receivedStringisnullor empty or its content is null.- Parameters:
text- the specified string to be parsedfeatures- the specified features is applied to parsing- Returns:
JSONArrayornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
- Parameters:
url- the specified url to be parsedfeatures- the specified features is applied to parsing- Returns:
JSONArrayornull- Throws:
JSONException- If an I/O error or parsing error occurs- See Also:
-
parseArray
Parses the json stream as aJSONArray. Returnsnullif receivedInputStreamisnullor its content is null.- Parameters:
in- the specified stream to be parsedfeatures- the specified features is applied to parsing- Returns:
JSONArrayornull- Throws:
JSONException- If an I/O error or parsing error occurs
-
parseArray
Parses the json stream as aJSONArray. Returnsnullif receivedInputStreamisnullor its content is null.- Parameters:
in- the specified stream to be parsedcharset- the specified charset of the streamcontext- the specified custom context- Returns:
JSONArrayornull- Throws:
JSONException- If an I/O error or parsing error occurs
-
parseArray
- Parameters:
text- the specified string to be parsedtype- the specified actual type ofJSONfeatures- the specified features is applied to parsing- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
- Parameters:
text- the specified string to be parsedtype- the specified actual type ofJSON- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
- Parameters:
text- the specified string to be parsedtype- the specified actual class ofJSON- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
- Parameters:
text- the specified string to be parsedtypes- the specified actual parameter type- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
- Parameters:
text- the specified string to be parsedtype- the specified actual class ofJSONfeatures- the specified features is applied to parsing- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
- Parameters:
chars- the specified char array to be parsedtype- the specified actual class ofJSONfeatures- the specified features is applied to parsing- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
Parses the json string as a list ofJSON. Returnsnullif receivedStringisnullor empty or its content is null.- Parameters:
text- the specified string to be parsedtypes- the specified actual parameter typefeatures- the specified features is applied to parsing- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
- Parameters:
bytes- the specified UTF8 text to be parsedtype- the specified actual type ofJSONfeatures- the specified features is applied to parsing- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
- Parameters:
bytes- the specified UTF8 text to be parsedtype- the specified actual class ofJSONfeatures- the specified features is applied to parsing- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
parseArray
static <T> List<T> parseArray(byte[] bytes, int offset, int length, Charset charset, Class<T> type, JSONReader.Feature... features) Parses the json byte array as a list ofJSON. Returnsnullif received byte array isnullor empty or the specified length is 0.- Parameters:
bytes- the specified UTF8 text to be parsedoffset- the starting index of arraylength- the specified length of arraycharset- the specified charset of the streamtype- the specified actual class ofJSONfeatures- the specified features is applied to parsing- Returns:
Listornull- Throws:
JSONException- If a parsing error occurs
-
toJSONString
Serializes the specified object to the json string- Parameters:
object- the specified object will be serialized- Returns:
Stringthat is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONString
Serializes the specified object to the json string- Parameters:
object- the specified object will be serializedcontext- the specified custom context- Returns:
Stringthat is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONString
Serializes the specified object to the json string- Parameters:
object- the specified object will be serializedfeatures- the specified features is applied to serialization- Returns:
Stringthat is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONString
Serializes the specified object to the json string- Parameters:
object- the specified object will be serializedfilter- the specified filter is applied to serializationfeatures- the specified features is applied to serialization- Returns:
Stringthat is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONString
Serializes the specified object to the json string- Parameters:
object- the specified object will be serializedfilters- the specified filters is applied to serializationfeatures- the specified features is applied to serialization- Returns:
Stringthat is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONString
Serializes the specified object to the json string- Parameters:
object- the specified object will be serializedformat- the specified date formatfeatures- the specified features is applied to serialization- Returns:
Stringthat is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONString
static String toJSONString(Object object, String format, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json string- Parameters:
object- the specified object will be serializedformat- the specified date formatfilters- the specified filters is applied to serializationfeatures- the specified features is applied to serialization- Returns:
Stringthat is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONBytes
Serializes the specified object to the json byte array- Parameters:
object- the specified object will be serialized- Returns:
byte[]that is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONBytes
Serializes the specified object to the json byte array- Parameters:
object- the specified object will be serializedcharset- the specified charset of the bytes- Returns:
byte[]that is not null- Throws:
JSONException- If a serialization error occurs- Since:
- 2.0.47
-
toJSONBytes
Serializes the specified object to the json byte array- Parameters:
object- the specified object will be serializedcharset- the specified charset of the bytescontext- the specified custom context- Returns:
byte[]that is not null- Throws:
JSONException- If a serialization error occurs- Since:
- 2.0.47
-
toJSONBytes
Serializes the specified object to the json byte array- Parameters:
object- the specified object will be serializedformat- the specified date formatfeatures- the specified features is applied to serialization- Returns:
byte[]that is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONBytes
Serializes the specified object to the json byte array- Parameters:
object- the specified object will be serializedfilters- the specified filters is applied to serialization- Returns:
byte[]that is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONBytes
Serializes the specified object to the json byte array- Parameters:
object- the specified object will be serializedfeatures- the specified features is applied to serialization- Returns:
byte[]that is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONBytes
Serializes the specified object to the json byte array- Parameters:
object- the specified object will be serializedfilters- the specified filters is applied to serializationfeatures- the specified features is applied to serialization- Returns:
byte[]that is not null- Throws:
JSONException- If a serialization error occurs
-
toJSONBytes
static byte[] toJSONBytes(Object object, String format, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json byte array- Parameters:
object- the specified object will be serializedformat- the specified date formatfilters- the specified filters is applied to serializationfeatures- the specified features is applied to serialization- Returns:
byte[]that is not null- Throws:
JSONException- If a serialization error occurs
-
writeTo
Serializes the specified object to the json byte array and write it toOutputStream- Parameters:
out- the specified output stream to be writtenobject- the specified object will be serialized- Returns:
- the length of byte stream
- Throws:
JSONException- If an I/O error or serialization error occurs
-
writeTo
Serializes the specified object to the json byte array and write it toOutputStream- Parameters:
out- the specified output stream to be writtenobject- the specified object will be serializedcontext- the specified custom context- Returns:
- the length of byte stream
- Throws:
JSONException- If an I/O error or serialization error occurs- Since:
- 2.0.51
-
writeTo
Serializes the specified object to the json byte array and write it toOutputStream- Parameters:
out- the specified output stream to be writtenobject- the specified object will be serializedfeatures- the specified features is applied to serialization- Returns:
- the length of byte stream
- Throws:
JSONException- If an I/O error or serialization error occurs
-
writeTo
static int writeTo(OutputStream out, Object object, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json byte array and write it toOutputStream- Parameters:
out- the specified output stream to be writtenobject- the specified object will be serializedfilters- the specified filters is applied to serializationfeatures- the specified features is applied to serialization- Returns:
- the length of byte stream
- Throws:
JSONException- If an I/O error or serialization error occurs
-
writeTo
static int writeTo(OutputStream out, Object object, String format, Filter[] filters, JSONWriter.Feature... features) Serializes the specified object to the json byte array and write it toOutputStream- Parameters:
out- the specified output stream to be writtenobject- the specified object will be serializedformat- the specified date formatfilters- the specified filters is applied to serializationfeatures- the specified features is applied to serialization- Returns:
- the length of byte stream
- Throws:
JSONException- If an I/O error or serialization error occurs
-
isValid
Verify that the json string is legal json text- Parameters:
text- the specified string will be validated- Returns:
trueorfalse
-
isValid
Verify that the json string is legal json text- Parameters:
text- the specified string will be validatedfeatures- the specified features is applied to parsing- Returns:
trueorfalse
-
isValid
static boolean isValid(char[] chars) Verify that the json char array is legal json text- Parameters:
chars- the specified array will be validated- Returns:
trueorfalse
-
isValidObject
Verify that the json string is a legal JsonObject- Parameters:
text- the specified string will be validated- Returns:
trueorfalse
-
isValidObject
static boolean isValidObject(byte[] bytes) Verify that the json byte array is a legal JsonObject- Parameters:
bytes- the specified array will be validated- Returns:
trueorfalse
-
isValidArray
Verify theStringis JSON Array- Parameters:
text- theStringto validate- Returns:
trueorfalse
-
isValid
static boolean isValid(byte[] bytes) Verify that the json byte array is legal json text- Parameters:
bytes- the specified array will be validated- Returns:
trueorfalse
-
isValid
Verify that the json byte array is legal json text- Parameters:
bytes- the specified array will be validatedcharset- the specified charset of the bytes- Returns:
trueorfalse
-
isValidArray
static boolean isValidArray(byte[] bytes) Verify that the json byte array is a legal JsonArray- Parameters:
bytes- the specified array will be validated- Returns:
trueorfalse
-
isValid
Verify that the json byte array is legal json text- Parameters:
bytes- the specified array will be validatedoffset- the starting index of arraylength- the specified length of arraycharset- the specified charset of the bytes- Returns:
trueorfalse
-
toJSON
- Parameters:
object- the specified object to be converted- Returns:
JSONArrayorJSONObjectornull
-
toJSON
- Parameters:
object- the specified object to be convertedfeatures- the specified features is applied to serialization- Returns:
JSONArrayorJSONObjectornull
-
to
Converts the specified object to an object of the specified goal type- Parameters:
clazz- the specified goal classobject- the specified object to be converted- Since:
- 2.0.4
-
toJavaObject
Deprecated.since 2.0.4, please useto(Class, Object)Converts the specified object to an object of the specified goal type- Parameters:
clazz- the specified goal classobject- the specified object to be converted
-
mixIn
- Since:
- 2.0.2
-
register
- Since:
- 2.0.2
- See Also:
-
register
- Since:
- 2.0.38
- See Also:
-
registerIfAbsent
-
registerIfAbsent
static ObjectReader<?> registerIfAbsent(Type type, ObjectReader<?> objectReader, boolean fieldBased) -
register
Register anObjectReaderModulein defaultObjectReaderProvider -
registerSeeAlsoSubType
-
registerSeeAlsoSubType
-
register
Register anObjectWriterModulein defaultObjectWriterProvider -
register
- Since:
- 2.0.2
- See Also:
-
register
- Since:
- 2.0.38
- See Also:
-
registerIfAbsent
-
registerIfAbsent
static ObjectWriter<?> registerIfAbsent(Type type, ObjectWriter<?> objectWriter, boolean fieldBased) -
register
Register ObjectWriterFilter- Parameters:
type-filter-- Since:
- 2.0.19
-
config
Enable the specified features in default reader- Parameters:
features- the specified features to be used- Since:
- 2.0.6
-
config
Enable or disable the specified features in default reader- Parameters:
feature- the specified feature to be usedstate- enable this feature if and only ifstateistrue, disable otherwise- Since:
- 2.0.6
-
isEnabled
Check if the default reader enables the specified feature- Parameters:
feature- the specified feature- Since:
- 2.0.6
-
configReaderDateFormat
config default reader dateFormat- Parameters:
dateFormat-- Since:
- 2.0.30
-
configWriterDateFormat
config default reader dateFormat- Parameters:
dateFormat-
-
configReaderZoneId
config default reader zoneId- Parameters:
zoneId-- Since:
- 2.0.36
-
configWriterZoneId
config default writer zoneId- Parameters:
zoneId-- Since:
- 2.0.36
-
config
Enable the specified features in default writer- Parameters:
features- the specified features to be used- Since:
- 2.0.6
-
config
Enable or disable the specified features in default writer- Parameters:
feature- the specified feature to be usedstate- enable this feature if and only ifstateistrue, disable otherwise- Since:
- 2.0.6
-
isEnabled
Check if the default writer enables the specified feature- Parameters:
feature- the specified feature- Since:
- 2.0.6
-
copy
Builds a newJSONusing the properties of the specified object- Parameters:
object- the specified object will be copiedfeatures- the specified features is applied to serialization- Since:
- 2.0.12
-
copyTo
Builds a new instance of targetClass using the properties of the specified object- Parameters:
object- the specified object will be copiedtargetClass- the specified target classfeatures- the specified features is applied to serialization- Since:
- 2.0.16
-
to(Class, Object)