Package com.alibaba.fastjson
Class JSONObject
- java.lang.Object
-
- com.alibaba.fastjson.JSON
-
- com.alibaba.fastjson.JSONObject
-
- All Implemented Interfaces:
JSONAware,com.alibaba.fastjson2.util.Wrapper,Serializable,Cloneable,InvocationHandler,Map<String,Object>
public class JSONObject extends JSON implements Map<String,Object>, Cloneable, Serializable, InvocationHandler, com.alibaba.fastjson2.util.Wrapper
- Author:
- wenshao[szujobs@hotmail.com]
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.alibaba.fastjson.JSON
DEFAULT_GENERATE_FEATURE, DEFAULT_PARSER_FEATURE, DEFAULT_TYPE_KEY, defaultLocale, defaultTimeZone, DEFFAULT_DATE_FORMAT, VERSION
-
-
Constructor Summary
Constructors Constructor Description JSONObject()JSONObject(boolean ordered)JSONObject(int initialCapacity)JSONObject(int initialCapacity, boolean ordered)JSONObject(Map<String,Object> map)
-
Method Summary
-
Methods inherited from class com.alibaba.fastjson.JSON
addMixInAnnotations, clearMixInAnnotations, configFilter, createReadContext, createReadContext, createWriteContext, getMixInAnnotations, isValid, isValidArray, isValidObject, parse, parse, parse, parse, parse, parse, parse, parse, parse, parseArray, parseArray, parseArray, parseArray, parseArray, parseArray, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, removeMixInAnnotations, toJavaObject, toJSON, toJSON, toJSON, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONStringWithDateFormat, toJSONStringZ, toString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONString, writeJSONString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<String,Object>
-
getJSONObject
public JSONObject getJSONObject(String key)
-
getObject
public <T> T getObject(String key, TypeReference typeReference)
-
getBytes
public byte[] getBytes(String key)
-
getBooleanValue
public boolean getBooleanValue(String key)
-
getByteValue
public byte getByteValue(String key)
-
getShortValue
public short getShortValue(String key)
-
getIntValue
public int getIntValue(String key)
-
getLongValue
public long getLongValue(String key)
-
getFloatValue
public float getFloatValue(String key)
-
getDoubleValue
public double getDoubleValue(String key)
-
getBigDecimal
public BigDecimal getBigDecimal(String key)
-
getBigInteger
public BigInteger getBigInteger(String key)
-
fluentPut
public JSONObject fluentPut(String key, Object value)
-
fluentPutAll
public JSONObject fluentPutAll(Map<? extends String,? extends Object> m)
-
fluentClear
public JSONObject fluentClear()
-
fluentRemove
public JSONObject fluentRemove(Object key)
-
equals
public boolean equals(Object obj)
-
hashCode
public int hashCode()
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
toJavaObject
public <T> T toJavaObject(Type type)
- Specified by:
toJavaObjectin classJSON
-
toJavaObject
public <T> T toJavaObject(Class<T> clazz)
- Specified by:
toJavaObjectin classJSON
-
toJavaObject
public <T> T toJavaObject(Class<T> clazz, ParserConfig config, int features)
-
unwrap
public <T> T unwrap(Class<T> iface)
- Specified by:
unwrapin interfacecom.alibaba.fastjson2.util.Wrapper
-
-