public abstract class JSON extends Object implements JSONStreamAware, JSONAware
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_GENERATE_FEATURE |
static int |
DEFAULT_PARSER_FEATURE |
static String |
DEFAULT_TYPE_KEY |
static Locale |
defaultLocale |
static TimeZone |
defaultTimeZone |
static String |
DEFFAULT_DATE_FORMAT |
static String |
VERSION |
| 构造器和说明 |
|---|
JSON() |
| 限定符和类型 | 方法和说明 |
|---|---|
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[] bytes,
int offset,
int len,
Charset charset,
Type clazz,
Feature... features) |
static <T> T |
parseObject(byte[] bytes,
Type clazz,
Feature... features) |
static <T> T |
parseObject(char[] input,
int length,
Type clazz,
Feature... features) |
static <T> T |
parseObject(InputStream is,
Charset charset,
Type type,
Feature... features) |
static <T> T |
parseObject(InputStream is,
Type type,
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 <T> T |
parseObject(String text,
Class<T> clazz,
ParseProcess processor,
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,
ParseProcess processor,
Feature... features) |
static <T> T |
parseObject(String input,
Type clazz,
ParserConfig config,
Feature... features) |
static <T> T |
parseObject(String input,
Type clazz,
ParserConfig config,
int featureValues,
Feature... features) |
static <T> T |
parseObject(String input,
Type clazz,
ParserConfig config,
ParseProcess processor,
int featureValues,
Feature... features) |
static <T> T |
parseObject(String text,
TypeReference<T> type,
Feature... features) |
<T> T |
toJavaObject(Class<T> clazz) |
static <T> T |
toJavaObject(JSON json,
Class<T> clazz) |
static Object |
toJSON(Object javaObject) |
static Object |
toJSON(Object javaObject,
ParserConfig parserConfig)
已过时。
|
static Object |
toJSON(Object javaObject,
SerializeConfig config) |
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,
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,
int defaultFeatures,
SerializerFeature... features) |
static String |
toJSONString(Object object,
SerializeConfig config,
SerializeFilter[] filters,
SerializerFeature... features) |
static String |
toJSONString(Object object,
SerializeConfig config,
SerializeFilter[] filters,
String dateFormat,
int defaultFeatures,
SerializerFeature... features) |
static String |
toJSONString(Object object,
SerializeConfig config,
SerializeFilter filter,
SerializerFeature... features) |
static String |
toJSONString(Object object,
SerializeConfig config,
SerializerFeature... features) |
static String |
toJSONString(Object object,
SerializeFilter[] filters,
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 int |
writeJSONString(OutputStream os,
Charset charset,
Object object,
SerializeConfig config,
SerializeFilter[] filters,
String dateFormat,
int defaultFeatures,
SerializerFeature... features) |
static int |
writeJSONString(OutputStream os,
Charset charset,
Object object,
SerializerFeature... features) |
static int |
writeJSONString(OutputStream os,
Object object,
int defaultFeatures,
SerializerFeature... features) |
static int |
writeJSONString(OutputStream os,
Object object,
SerializerFeature... features)
write object as json to OutputStream
|
static void |
writeJSONString(Writer writer,
Object object,
int defaultFeatures,
SerializerFeature... features) |
static void |
writeJSONString(Writer writer,
Object object,
SerializerFeature... features)
write object as json to Writer
|
static void |
writeJSONStringTo(Object object,
Writer writer,
SerializerFeature... features)
已过时。
use writeJSONString
|
public static TimeZone defaultTimeZone
public static Locale defaultLocale
public static String DEFAULT_TYPE_KEY
public static int DEFAULT_PARSER_FEATURE
public static String DEFFAULT_DATE_FORMAT
public static int DEFAULT_GENERATE_FEATURE
public static Object parse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, Feature... features)
public static Object parse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, int features)
public static JSONObject parseObject(String text, Feature... features)
public static JSONObject parseObject(String text)
public static <T> T parseObject(String text, TypeReference<T> type, Feature... features)
public static <T> T parseObject(String text, Class<T> clazz, ParseProcess processor, Feature... features)
public static <T> T parseObject(String input, Type clazz, ParseProcess processor, Feature... features)
public static <T> T parseObject(String input, Type clazz, int featureValues, Feature... features)
public static <T> T parseObject(String input, Type clazz, ParserConfig config, Feature... features)
public static <T> T parseObject(String input, Type clazz, ParserConfig config, int featureValues, Feature... features)
public static <T> T parseObject(String input, Type clazz, ParserConfig config, ParseProcess processor, int featureValues, Feature... features)
public static <T> T parseObject(byte[] bytes,
int offset,
int len,
Charset charset,
Type clazz,
Feature... features)
public static <T> T parseObject(byte[] input,
int off,
int len,
CharsetDecoder charsetDecoder,
Type clazz,
Feature... features)
public static <T> T parseObject(char[] input,
int length,
Type clazz,
Feature... features)
public static <T> T parseObject(InputStream is, Type type, Feature... features) throws IOException
IOExceptionpublic static <T> T parseObject(InputStream is, Charset charset, Type type, Feature... features) throws IOException
IOExceptionpublic static String toJSONString(Object object, SerializerFeature... features)
public static String toJSONString(Object object, int defaultFeatures, SerializerFeature... features)
public static String toJSONStringWithDateFormat(Object object, String dateFormat, SerializerFeature... features)
public static String toJSONString(Object object, SerializeFilter filter, SerializerFeature... features)
public static String toJSONString(Object object, SerializeFilter[] filters, SerializerFeature... features)
public static byte[] toJSONBytes(Object object, SerializerFeature... features)
public static byte[] toJSONBytes(Object object, int defaultFeatures, SerializerFeature... features)
public static String toJSONString(Object object, SerializeConfig config, SerializerFeature... features)
public static String toJSONString(Object object, SerializeConfig config, SerializeFilter filter, SerializerFeature... features)
public static String toJSONString(Object object, SerializeConfig config, SerializeFilter[] filters, SerializerFeature... features)
public static String toJSONString(Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, int defaultFeatures, SerializerFeature... features)
public static String toJSONStringZ(Object object, SerializeConfig mapping, SerializerFeature... features)
public static byte[] toJSONBytes(Object object, SerializeConfig config, SerializerFeature... features)
public static byte[] toJSONBytes(Object object, SerializeConfig config, int defaultFeatures, SerializerFeature... features)
public static void writeJSONStringTo(Object object, Writer writer, SerializerFeature... features)
public static void writeJSONString(Writer writer, Object object, SerializerFeature... features)
writer - output writerobject - features - serializer featurespublic static void writeJSONString(Writer writer, Object object, int defaultFeatures, SerializerFeature... features)
public static final int writeJSONString(OutputStream os, Object object, SerializerFeature... features) throws IOException
os - output streamobject - features - serializer featuresIOExceptionpublic static final int writeJSONString(OutputStream os, Object object, int defaultFeatures, SerializerFeature... features) throws IOException
IOExceptionpublic static final int writeJSONString(OutputStream os, Charset charset, Object object, SerializerFeature... features) throws IOException
IOExceptionpublic static final int writeJSONString(OutputStream os, Charset charset, Object object, SerializeConfig config, SerializeFilter[] filters, String dateFormat, int defaultFeatures, SerializerFeature... features) throws IOException
IOExceptionpublic String toJSONString()
toJSONString 在接口中 JSONAwarepublic void writeJSONString(Appendable appendable)
JSONStreamAwarewriteJSONString 在接口中 JSONStreamAwarepublic static Object toJSON(Object javaObject, ParserConfig parserConfig)
public static Object toJSON(Object javaObject, SerializeConfig config)
public <T> T toJavaObject(Class<T> clazz)
Copyright © 2012–2016 Alibaba Group. All rights reserved.