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 TypeMethodDescriptionstatic voidaddMixInAnnotations(Type target, Type mixinSource) static voidstatic voidconfigFilter(com.alibaba.fastjson2.JSONWriter.Context context, SerializeFilter filter) static com.alibaba.fastjson2.JSONReader.ContextcreateReadContext(int featuresValue, Feature... features) static com.alibaba.fastjson2.JSONWriter.ContextcreateWriteContext(SerializeConfig config, int featuresValue, SerializerFeature... features) static TypegetMixInAnnotations(Type target) static booleanstatic booleanisValidArray(String str) static booleanisValidObject(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 Objectstatic Objectstatic Objectstatic Objectparse(String str, ParserConfig config) static Objectparse(String str, ParserConfig config, int features) static Objectparse(String str, ParserConfig config, Feature... features) static JSONArrayparseArray(String str) static 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) static <T> List<T>parseArray(String text, Class<T> clazz, ParserConfig config) 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> TparseObject(byte[] bytes, int offset, int len, Charset charset, Type objectType, ParserConfig config, ParseProcess processor, int featureValues, 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(byte[] bytes, Charset charset, Type objectClass, ParserConfig config, ParseProcess processor, int featureValues, Feature... features) static <T> TparseObject(char[] str, int length, Type objectType, 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 <T> TparseObject(InputStream is, Charset charset, Type objectType, ParserConfig config, ParseProcess processor, int featureValues, Feature... features) static <T> TparseObject(InputStream is, Charset charset, Type type, ParserConfig config, Feature... features) static JSONObjectparseObject(String str) static JSONObjectparseObject(String text, Feature... features) static <T> TparseObject(String str, TypeReference<T> typeReference, Feature... features) static <T> TparseObject(String str, Class<T> objectClass) static <T> TparseObject(String str, Class<T> objectClass, ParseProcess processor, Feature... features) static <T> TparseObject(String str, Class<T> objectType, Feature... features) static <T> TparseObject(String input, Type clazz, int featureValues, Feature... features) static <T> TparseObject(String str, Type objectType, ParseProcess processor, Feature... features) static <T> TparseObject(String str, Type objectType, Feature... features) static <T> TparseObject(String input, Type clazz, ParserConfig config, int featureValues, Feature... features) static <T> TparseObject(String str, Type objectClass, ParserConfig config, ParseProcess processor, int featureValues, Feature... features) static <T> TparseObject(String str, Type objectType, ParserConfig config, Feature... features) static voidremoveMixInAnnotations(Type target) static <T> TtoJavaObject(JSON json, Class<T> clazz) <T> TtoJavaObject(TypeReference<T> typeReference) abstract <T> TtoJavaObject(Class<T> objectClass) abstract <T> TtoJavaObject(Type type) static Objectstatic ObjecttoJSON(Object javaObject, ParserConfig config) static ObjecttoJSON(Object javaObject, SerializeConfig config) static byte[]toJSONBytes(Object object) static byte[]toJSONBytes(Object object, int defaultFeatures, SerializerFeature... features) static byte[]toJSONBytes(Object object, SerializeConfig config, int defaultFeatures, SerializerFeature... features) static byte[]toJSONBytes(Object object, SerializeConfig config, SerializeFilter[] filters, int defaultFeatures, SerializerFeature... features) static byte[]toJSONBytes(Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, int defaultFeatures, SerializerFeature... features) static byte[]toJSONBytes(Object object, SerializeConfig config, SerializeFilter filter, SerializerFeature... features) static byte[]toJSONBytes(Object object, SerializeConfig config, SerializerFeature... features) static byte[]toJSONBytes(Object object, SerializeFilter filter) static byte[]toJSONBytes(Object object, SerializeFilter... filters) static byte[]toJSONBytes(Object object, SerializeFilter[] filters, SerializerFeature... features) static byte[]toJSONBytes(Object object, SerializeFilter filter, SerializerFeature... features) static byte[]toJSONBytes(Object object, SerializerFeature... features) static byte[]toJSONBytes(Charset charset, Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, int defaultFeatures, 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[] filters, SerializerFeature... features) static StringtoJSONString(Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, 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 StringtoJSONStringZ(Object object, SerializeConfig mapping, SerializerFeature... features) toString(SerializerFeature... features) static final intwriteJSONString(OutputStream os, Object object, int defaultFeatures, 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) static final intwriteJSONString(OutputStream os, Charset charset, Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, int defaultFeatures, SerializerFeature... features) static final intwriteJSONString(OutputStream os, Charset charset, Object object, SerializerFeature... features) static voidwriteJSONString(Writer writer, Object object, int defaultFeatures, SerializerFeature... features) static voidwriteJSONString(Writer writer, Object object, SerializerFeature... features) voidwriteJSONString(Appendable appendable)
-
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
-
createReadContext
public static com.alibaba.fastjson2.JSONReader.Context createReadContext(int featuresValue, Feature... features) -
parseObject
-
parseObject
-
parseObject
public static <T> T parseObject(byte[] bytes, Charset charset, Type objectClass, ParserConfig config, ParseProcess processor, int featureValues, Feature... features) -
parseObject
public static <T> T parseObject(byte[] bytes, int offset, int len, Charset charset, Type objectType, ParserConfig config, ParseProcess processor, int featureValues, Feature... features) -
parseObject
-
parseObject
-
parseObject
public static <T> T parseObject(String str, Type objectClass, ParserConfig config, ParseProcess processor, int featureValues, Feature... features) -
parseObject
public static <T> T parseObject(String input, Type clazz, ParserConfig config, int featureValues, Feature... features) -
parseObject
public static <T> T parseObject(String str, Type objectType, ParseProcess processor, Feature... features) -
parseObject
public static <T> T parseObject(String str, Class<T> objectClass, ParseProcess processor, Feature... features) -
parseObject
-
parseObject
-
parseObject
-
parseObject
-
parseObject
-
parseObject
public static <T> T parseObject(String str, Type objectType, ParserConfig config, Feature... features) - Since:
- 1.2.11
-
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, ParserConfig config, ParseProcess processor, int featureValues, Feature... features) throws IOException - Throws:
IOException
-
parseObject
public static <T> T parseObject(InputStream is, Charset charset, Type type, ParserConfig config, 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
-
parse
-
parse
-
parse
-
parse
-
parse
-
parse
-
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
-
createWriteContext
public static com.alibaba.fastjson2.JSONWriter.Context createWriteContext(SerializeConfig config, int featuresValue, SerializerFeature... features) -
toJSONString
public static String toJSONString(Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, int defaultFeatures, SerializerFeature... features) -
toJSONString
public static String toJSONString(Object object, SerializeConfig config, SerializeFilter[] filters, SerializerFeature... features) -
toJSONString
public static String toJSONString(Object object, SerializeFilter[] filters, SerializerFeature... features) -
configFilter
public static void configFilter(com.alibaba.fastjson2.JSONWriter.Context context, SerializeFilter filter) -
toJSONBytes
public static byte[] toJSONBytes(Object object, SerializeConfig config, SerializeFilter[] filters, int defaultFeatures, SerializerFeature... features) -
toJSONBytes
public static byte[] toJSONBytes(Object object, SerializeConfig config, SerializeFilter filter, SerializerFeature... features) -
toJSONBytes
public static byte[] toJSONBytes(Charset charset, Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, int defaultFeatures, SerializerFeature... features) -
toJSONBytes
public static byte[] toJSONBytes(Object object, SerializeFilter[] filters, SerializerFeature... features) -
toJSONBytes
public static byte[] toJSONBytes(Object object, SerializeConfig config, SerializerFeature... features) -
toJSONString
-
toJSONString
-
toJSONString
public static String toJSONString(Object object, SerializeFilter filter0, SerializeFilter filter1, SerializeFilter... filters) -
toJSONString
-
toJSONBytes
-
toJSONBytes
-
toJSONBytes
-
toJSONBytes
-
toJSONBytes
public static byte[] toJSONBytes(Object object, SerializeFilter filter, SerializerFeature... features) -
toJSONBytes
public static byte[] toJSONBytes(Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, int defaultFeatures, SerializerFeature... features) -
toJSONBytes
-
toJSONBytes
public static byte[] toJSONBytes(Object object, SerializeConfig config, int defaultFeatures, SerializerFeature... features) -
toJSONString
public static String toJSONString(Object object, SerializeConfig config, SerializerFeature... features) -
toJSONStringZ
public static String toJSONStringZ(Object object, SerializeConfig mapping, 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, Charset charset, Object object, SerializerFeature... features) throws IOException - Throws:
IOException
-
writeJSONString
-
writeJSONString
public static void writeJSONString(Writer writer, Object object, int defaultFeatures, SerializerFeature... features) -
writeJSONString
public static final int writeJSONString(OutputStream os, Object object, int defaultFeatures, SerializerFeature... features) throws IOException - Throws:
IOException
-
writeJSONString
public static final int writeJSONString(OutputStream os, Charset charset, Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, int defaultFeatures, SerializerFeature... features) 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
-
parseArray
-
parseArray
-
isValid
-
isValidArray
-
isValidObject
-
toJavaObject
-
toJavaObject
-
toJavaObject
-
toJavaObject
-
toJSON
-
toJSON
-
toJSON
-
parseArray
-
addMixInAnnotations
-
removeMixInAnnotations
-
clearMixInAnnotations
public static void clearMixInAnnotations() -
getMixInAnnotations
-
toJSONString
-
toString
-
writeJSONString
-