com.alibaba.fastjson
类 JSON
java.lang.Object
com.alibaba.fastjson.JSON
- 所有已实现的接口:
- JSONAware, JSONStreamAware
- 直接已知子类:
- JSONArray, JSONObject
public abstract class JSON
- extends Object
- implements JSONStreamAware, JSONAware
- 作者:
- wenshao
|
方法摘要 |
static void |
handleResovleTask(DefaultJSONParser parser,
Object 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
|
parseArray(String text,
Class<T> clazz)
|
static List<Object> |
parseArray(String text,
Type[] types)
|
static
|
parseObject(byte[] input,
int off,
int len,
CharsetDecoder charsetDecoder,
Type clazz,
Feature... features)
|
static
|
parseObject(byte[] input,
Type clazz,
Feature... features)
|
static
|
parseObject(char[] input,
int length,
Type clazz,
Feature... features)
|
static JSONObject |
parseObject(String text)
|
static
|
parseObject(String text,
Class<T> clazz)
|
static
|
parseObject(String text,
Class<T> clazz,
Feature... features)
|
static
|
parseObject(String text,
Class<T> clazz,
ParseProcess processor,
Feature... features)
|
static JSONObject |
parseObject(String text,
Feature... features)
|
static
|
parseObject(String input,
Type clazz,
Feature... features)
|
static
|
parseObject(String input,
Type clazz,
int featureValues,
Feature... features)
|
static
|
parseObject(String input,
Type clazz,
ParseProcess processor,
Feature... features)
|
static
|
parseObject(String input,
Type clazz,
ParserConfig config,
int featureValues,
Feature... features)
|
static
|
parseObject(String input,
Type clazz,
ParserConfig config,
ParseProcess processor,
int featureValues,
Feature... features)
|
static
|
parseObject(String text,
TypeReference<T> type,
Feature... features)
|
static
|
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. |
static void |
writeJSONStringTo(Object object,
Writer writer,
SerializerFeature... features)
|
DEFAULT_TYPE_KEY
public static String DEFAULT_TYPE_KEY
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
- 另请参见:
- 常量字段值
JSON
public JSON()
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 text,
Class<T> clazz,
ParseProcess processor,
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,
ParseProcess processor,
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)
parseObject
public static final <T> T parseObject(String input,
Type clazz,
ParserConfig config,
ParseProcess processor,
int featureValues,
Feature... features)
handleResovleTask
public static void handleResovleTask(DefaultJSONParser parser,
Object 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)
- 从以下版本开始:
- 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)
writeJSONStringTo
public static final void writeJSONStringTo(Object object,
Writer writer,
SerializerFeature... features)
toString
public String toString()
- 覆盖:
- 类
Object 中的 toString
toJSONString
public String toJSONString()
- 指定者:
- 接口
JSONAware 中的 toJSONString
- 返回:
- JSON text
writeJSONString
public void writeJSONString(Appendable appendable)
- 从接口
JSONStreamAware 复制的描述
- write JSON string to out.
- 指定者:
- 接口
JSONStreamAware 中的 writeJSONString
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-2014 Alibaba Group. All Rights Reserved.