Package com.alibaba.fastjson
Class JSON
java.lang.Object
com.alibaba.fastjson.JSON
- Direct Known Subclasses:
JSONArray,JSONObject
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidstatic voidconfig(com.alibaba.fastjson2.JSONWriter.Context ctx, SerializerFeature[] features) static voidconfigFilter(com.alibaba.fastjson2.JSONWriter.Context context, SerializeFilter... filters) static booleanstatic booleanisValidArray(String str) static Objectparse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, int features) static Objectparse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, Feature... features) static Objectstatic JSONArrayparseArray(String str, Feature... features) static <T> List<T>parseArray(String text, Class<T> type) static <T> List<T>parseArray(String text, Class<T> type, Feature... features) parseArray(String text, Type[] types) static <T> TparseObject(byte[] input, int off, int len, CharsetDecoder charsetDecoder, Type clazz, Feature... features) static <T> TparseObject(byte[] input, int off, int len, Charset charset, Type clazz, Feature... features) static <T> JSONObjectparseObject(byte[] jsonBytes, Feature... features) static <T> TparseObject(byte[] jsonBytes, Type type, Feature... features) static <T> TparseObject(byte[] jsonBytes, Type type, SerializeFilter filter, Feature... features) static <T> TparseObject(char[] str, Class<T> objectClass, Feature... features) static <T> TparseObject(InputStream is, Class<T> objectType, Feature... features) static <T> TparseObject(InputStream is, Type objectType, Feature... features) static <T> TparseObject(InputStream is, Charset charset, Type objectType, Feature... features) static JSONObjectparseObject(String str) static JSONObjectparseObject(String text, Feature... features) static <T> TparseObject(String str, TypeReference typeReference, Feature... features) static <T> TparseObject(String str, Class<T> objectClass) static <T> TparseObject(String str, Class<T> objectType, Feature... features) static <T> TparseObject(String str, Type objectType, Feature... features) static <T> TtoJavaObject(JSON json, Class<T> clazz) static Objectstatic byte[]toJSONBytes(Object object) static byte[]toJSONBytes(Object object, SerializeFilter... filters) static byte[]toJSONBytes(Object object, SerializeFilter[] filters, SerializerFeature... features) static byte[]toJSONBytes(Object object, SerializerFeature... features) static StringtoJSONString(Object object) static StringtoJSONString(Object object, boolean prettyFormat) static StringtoJSONString(Object object, int defaultFeatures, SerializerFeature... features) static StringtoJSONString(Object object, SerializeConfig config, SerializeFilter filter, SerializerFeature... features) static StringtoJSONString(Object object, SerializeConfig config, SerializerFeature... features) static StringtoJSONString(Object object, SerializeFilter[] filters, SerializerFeature... features) static StringtoJSONString(Object object, SerializeFilter filter0, SerializeFilter filter1, SerializeFilter... filters) static StringtoJSONString(Object object, SerializeFilter filter, SerializerFeature... features) static StringtoJSONString(Object object, SerializerFeature... features) static StringtoJSONStringWithDateFormat(Object object, String dateFormat, SerializerFeature... features) static final intwriteJSONString(OutputStream os, Object object, SerializeFilter[] filters) static final intwriteJSONString(OutputStream os, Object object, SerializeFilter[] filters, SerializerFeature... features) static final intwriteJSONString(OutputStream os, Object object, SerializerFeature... features)
-
Field Details
-
VERSION
- See Also:
-
defaultTimeZone
-
defaultLocale
-
DEFAULT_TYPE_KEY
-
DEFFAULT_DATE_FORMAT
-
DEFAULT_PARSER_FEATURE
public static int DEFAULT_PARSER_FEATURE -
DEFAULT_GENERATE_FEATURE
public static int DEFAULT_GENERATE_FEATURE
-
-
Constructor Details
-
JSON
public JSON()
-
-
Method Details
-
parseObject
-
parseObject
-
parseObject
-
parseObject
-
parseObject
-
parseObject
-
parseObject
-
parseObject
public static <T> T parseObject(InputStream is, Type objectType, Feature... features) throws IOException - Throws:
IOException
-
parseObject
public static <T> T parseObject(InputStream is, Class<T> objectType, Feature... features) throws IOException - Throws:
IOException
-
parseObject
public static <T> T parseObject(InputStream is, Charset charset, Type objectType, Feature... features) throws IOException - Throws:
IOException
-
parseObject
- Since:
- 2.0.7
-
parseObject
-
parseObject
public static <T> T parseObject(byte[] jsonBytes, Type type, SerializeFilter filter, Feature... features) -
parse
-
config
-
parse
public static Object parse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, Feature... features) -
parse
public static Object parse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, int features) -
parseObject
public static <T> T parseObject(byte[] input, int off, int len, CharsetDecoder charsetDecoder, Type clazz, Feature... features) -
parseObject
-
toJSONString
public static String toJSONString(Object object, SerializeFilter[] filters, SerializerFeature... features) -
configFilter
public static void configFilter(com.alibaba.fastjson2.JSONWriter.Context context, SerializeFilter... filters) -
toJSONBytes
public static byte[] toJSONBytes(Object object, SerializeFilter[] filters, SerializerFeature... features) -
toJSONString
-
toJSONString
-
toJSONString
public static String toJSONString(Object object, SerializeFilter filter0, SerializeFilter filter1, SerializeFilter... filters) -
toJSONString
-
toJSONBytes
-
toJSONBytes
-
toJSONBytes
-
config
public static void config(com.alibaba.fastjson2.JSONWriter.Context ctx, SerializerFeature[] features) -
toJSONString
public static String toJSONString(Object object, SerializeConfig config, SerializerFeature... features) -
toJSONString
public static String toJSONString(Object object, SerializeConfig config, SerializeFilter filter, SerializerFeature... features) -
toJSONString
public static String toJSONString(Object object, SerializeFilter filter, SerializerFeature... features) -
toJSONString
public static String toJSONString(Object object, int defaultFeatures, SerializerFeature... features) -
toJSONStringWithDateFormat
public static String toJSONStringWithDateFormat(Object object, String dateFormat, SerializerFeature... features) -
writeJSONString
public static final int writeJSONString(OutputStream os, Object object, SerializerFeature... features) throws IOException - Throws:
IOException
-
writeJSONString
public static final int writeJSONString(OutputStream os, Object object, SerializeFilter[] filters) throws IOException - Throws:
IOException
-
writeJSONString
public static final int writeJSONString(OutputStream os, Object object, SerializeFilter[] filters, SerializerFeature... features) throws IOException - Throws:
IOException
-
parseArray
-
parseArray
-
parseArray
-
isValid
-
isValidArray
-
toJavaObject
-
toJSON
-
parseArray
-