JSON (fastjson 1.1.26 API)

fastjson



com.alibaba.fastjson Class JSON

java.lang.Object
  extended by com.alibaba.fastjson.JSON
All Implemented Interfaces:
JSONAware, JSONStreamAware
Direct Known Subclasses:
JSONArray, JSONObject

public abstract class JSON
extends Object
implements JSONStreamAware, JSONAware

Author:
wenshao

Field Summary
static int
static int
static String
static String
 
Constructor Summary
 
Method Summary
static
<T> int
handleResovleTask(DefaultJSONParser parser, T value)
            static Object parse(byte[] input, Feature... features)
            static Object parse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, Feature... features)
            static Object parse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, int features)
            static Object parse(String text)
            static Object parse(String text, Feature... features)
            static Object parse(String text, int features)
            static JSONArray parseArray(String text)
           
static
<T> List<T>
parseArray(String text, Class<T> clazz)
            static List<Object> parseArray(String text, Type[] types)
           
static
<T> T
parseObject(byte[] input, int off, int len, CharsetDecoder charsetDecoder, Type clazz, Feature... features)
           
static
<T> T
parseObject(byte[] input, Type clazz, Feature... features)
           
static
<T> T
parseObject(char[] input, int length, Type clazz, Feature... features)
            static JSONObject parseObject(String text)
           
static
<T> T
parseObject(String text, Class<T> clazz)
           
static
<T> T
parseObject(String text, Class<T> clazz, Feature... features)
            static JSONObject parseObject(String text, Feature... features)
           
static
<T> T
parseObject(String input, Type clazz, Feature... features)
           
static
<T> T
parseObject(String input, Type clazz, int featureValues, Feature... features)
           
static
<T> T
parseObject(String input, Type clazz, ParserConfig config, int featureValues, Feature... features)
           
static
<T> T
parseObject(String text, TypeReference<T> type, Feature... features)
           
static
<T> T
toJavaObject(JSON json, Class<T> clazz)
            static Object toJSON(Object javaObject)
            static Object toJSON(Object javaObject, ParserConfig mapping)
            static byte[] toJSONBytes(Object object, SerializeConfig config, SerializerFeature... features)
            static byte[] toJSONBytes(Object object, SerializerFeature... features)
             String toJSONString()
            static String toJSONString(Object object)
            static String toJSONString(Object object, boolean prettyFormat)
            static String toJSONString(Object object, SerializeConfig config, SerializerFeature... features)
            static String toJSONString(Object object, SerializeFilter filter, SerializerFeature... features)
            static String toJSONString(Object object, SerializerFeature... features)
            static String toJSONStringWithDateFormat(Object object, String dateFormat, SerializerFeature... features)
            static String toJSONStringZ(Object object, SerializeConfig mapping, SerializerFeature... features)
             String toString()
             void writeJSONString(Appendable appendable)
          write JSON string to out.  
Methods inherited from class java.lang.Object
 

Field Detail

DEFAULT_PARSER_FEATURE

public static int DEFAULT_PARSER_FEATURE

DEFFAULT_DATE_FORMAT

public static String DEFFAULT_DATE_FORMAT

DEFAULT_GENERATE_FEATURE

public static int DEFAULT_GENERATE_FEATURE

VERSION

public static final String VERSION
See Also:
Constant Field Values
Constructor Detail

JSON

public JSON()
Method Detail

parse

public static final Object parse(String text)

parse

public static final Object parse(String text,
                                 int features)

parse

public static final Object parse(byte[] input,
                                 Feature... features)

parse

public static final Object parse(byte[] input,
                                 int off,
                                 int len,
                                 CharsetDecoder charsetDecoder,
                                 Feature... features)

parse

public static final Object parse(byte[] input,
                                 int off,
                                 int len,
                                 CharsetDecoder charsetDecoder,
                                 int features)

parse

public static final Object parse(String text,
                                 Feature... features)

parseObject

public static final JSONObject parseObject(String text,
                                           Feature... features)

parseObject

public static final JSONObject parseObject(String text)

parseObject

public static final <T> T parseObject(String text,
                                      TypeReference<T> type,
                                      Feature... features)

parseObject

public static final <T> T parseObject(String text,
                                      Class<T> clazz,
                                      Feature... features)

parseObject

public static final <T> T parseObject(String input,
                                      Type clazz,
                                      Feature... features)

parseObject

public static final <T> T parseObject(String input,
                                      Type clazz,
                                      int featureValues,
                                      Feature... features)

parseObject

public static final <T> T parseObject(String input,
                                      Type clazz,
                                      ParserConfig config,
                                      int featureValues,
                                      Feature... features)

handleResovleTask

public static <T> int handleResovleTask(DefaultJSONParser parser,
                                        T value)

parseObject

public static final <T> T parseObject(byte[] input,
                                      Type clazz,
                                      Feature... features)

parseObject

public static final <T> T parseObject(byte[] input,
                                      int off,
                                      int len,
                                      CharsetDecoder charsetDecoder,
                                      Type clazz,
                                      Feature... features)

parseObject

public static final <T> T parseObject(char[] input,
                                      int length,
                                      Type clazz,
                                      Feature... features)

parseObject

public static final <T> T parseObject(String text,
                                      Class<T> clazz)

parseArray

public static final JSONArray parseArray(String text)

parseArray

public static final <T> List<T> parseArray(String text,
                                           Class<T> clazz)

parseArray

public static final List<Object> parseArray(String text,
                                            Type[] types)

toJSONString

public static final String toJSONString(Object object)

toJSONString

public static final String toJSONString(Object object,
                                        SerializerFeature... features)

toJSONStringWithDateFormat

public static final String toJSONStringWithDateFormat(Object object,
                                                      String dateFormat,
                                                      SerializerFeature... features)
Since:
1.1.14

toJSONString

public static final String toJSONString(Object object,
                                        SerializeFilter filter,
                                        SerializerFeature... features)

toJSONBytes

public static final byte[] toJSONBytes(Object object,
                                       SerializerFeature... features)

toJSONString

public static final String toJSONString(Object object,
                                        SerializeConfig config,
                                        SerializerFeature... features)

toJSONStringZ

public static final String toJSONStringZ(Object object,
                                         SerializeConfig mapping,
                                         SerializerFeature... features)

toJSONBytes

public static final byte[] toJSONBytes(Object object,
                                       SerializeConfig config,
                                       SerializerFeature... features)

toJSONString

public static final String toJSONString(Object object,
                                        boolean prettyFormat)

toString

public String toString()
Overrides:
toString in class Object

toJSONString

public String toJSONString()
Specified by:
toJSONString in interface JSONAware
Returns:
JSON text

writeJSONString

public void writeJSONString(Appendable appendable)
Description copied from interface: JSONStreamAware
write JSON string to out.

Specified by:
writeJSONString in interface JSONStreamAware

toJSON

public static final Object toJSON(Object javaObject)

toJSON

public static final Object toJSON(Object javaObject,
                                  ParserConfig mapping)

toJavaObject

public static final <T> T toJavaObject(JSON json,
                                       Class<T> clazz)


Copyright © 2012 Alibaba Group. All Rights Reserved.