com.alibaba.fastjson
Class JSONObject

java.lang.Object
  extended by com.alibaba.fastjson.JSON
      extended by com.alibaba.fastjson.JSONObject
All Implemented Interfaces:
JSONAware, JSONStreamAware, Serializable, Cloneable, InvocationHandler, Map<String,Object>

public class JSONObject
extends JSON
implements Map<String,Object>, JSONAware, Cloneable, Serializable, InvocationHandler

Author:
wenshao
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.alibaba.fastjson.JSON
DEFAULT_GENERATE_FEATURE, DEFAULT_PARSER_FEATURE, DEFFAULT_DATE_FORMAT, VERSION
 
Constructor Summary
JSONObject()
           
JSONObject(boolean ordered)
           
JSONObject(int initialCapacity)
           
JSONObject(int initialCapacity, boolean ordered)
           
JSONObject(Map<String,Object> map)
           
 
Method Summary
 void clear()
           
 Object clone()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<String,Object>> entrySet()
           
 boolean equals(Object obj)
           
 Object get(Object key)
           
 BigDecimal getBigDecimal(String key)
           
 BigInteger getBigInteger(String key)
           
 Boolean getBoolean(String key)
           
 boolean getBooleanValue(String key)
           
 Byte getByte(String key)
           
 byte[] getBytes(String key)
           
 byte getByteValue(String key)
           
 Date getDate(String key)
           
 Double getDouble(String key)
           
 double getDoubleValue(String key)
           
 Float getFloat(String key)
           
 float getFloatValue(String key)
           
 Integer getInteger(String key)
           
 int getIntValue(String key)
           
 JSONArray getJSONArray(String key)
           
 JSONObject getJSONObject(String key)
           
 Long getLong(String key)
           
 long getLongValue(String key)
           
<T> T
getObject(String key, Class<T> clazz)
           
 Short getShort(String key)
           
 short getShortValue(String key)
           
 Date getSqlDate(String key)
           
 String getString(String key)
           
 Timestamp getTimestamp(String key)
           
 int hashCode()
           
 Object invoke(Object proxy, Method method, Object[] args)
           
 boolean isEmpty()
           
 Set<String> keySet()
           
 Object put(String key, Object value)
           
 void putAll(Map<? extends String,? extends Object> m)
           
 Object remove(Object key)
           
 int size()
           
 Collection<Object> values()
           
 
Methods inherited from class com.alibaba.fastjson.JSON
handleResovleTask, parse, parse, parse, parse, parse, parse, parseArray, parseArray, parseArray, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, toJavaObject, toJSON, toJSON, toJSONBytes, toJSONBytes, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONStringWithDateFormat, toJSONStringZ, toString, writeJSONString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.alibaba.fastjson.JSONAware
toJSONString
 

Constructor Detail

JSONObject

public JSONObject()

JSONObject

public JSONObject(Map<String,Object> map)

JSONObject

public JSONObject(boolean ordered)

JSONObject

public JSONObject(int initialCapacity)

JSONObject

public JSONObject(int initialCapacity,
                  boolean ordered)
Method Detail

size

public int size()
Specified by:
size in interface Map<String,Object>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<String,Object>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<String,Object>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<String,Object>

get

public Object get(Object key)
Specified by:
get in interface Map<String,Object>

getJSONObject

public JSONObject getJSONObject(String key)

getJSONArray

public JSONArray getJSONArray(String key)

getObject

public <T> T getObject(String key,
                       Class<T> clazz)

getBoolean

public Boolean getBoolean(String key)

getBytes

public byte[] getBytes(String key)

getBooleanValue

public boolean getBooleanValue(String key)

getByte

public Byte getByte(String key)

getByteValue

public byte getByteValue(String key)

getShort

public Short getShort(String key)

getShortValue

public short getShortValue(String key)

getInteger

public Integer getInteger(String key)

getIntValue

public int getIntValue(String key)

getLong

public Long getLong(String key)

getLongValue

public long getLongValue(String key)

getFloat

public Float getFloat(String key)

getFloatValue

public float getFloatValue(String key)

getDouble

public Double getDouble(String key)

getDoubleValue

public double getDoubleValue(String key)

getBigDecimal

public BigDecimal getBigDecimal(String key)

getBigInteger

public BigInteger getBigInteger(String key)

getString

public String getString(String key)

getDate

public Date getDate(String key)

getSqlDate

public Date getSqlDate(String key)

getTimestamp

public Timestamp getTimestamp(String key)

put

public Object put(String key,
                  Object value)
Specified by:
put in interface Map<String,Object>

putAll

public void putAll(Map<? extends String,? extends Object> m)
Specified by:
putAll in interface Map<String,Object>

clear

public void clear()
Specified by:
clear in interface Map<String,Object>

remove

public Object remove(Object key)
Specified by:
remove in interface Map<String,Object>

keySet

public Set<String> keySet()
Specified by:
keySet in interface Map<String,Object>

values

public Collection<Object> values()
Specified by:
values in interface Map<String,Object>

entrySet

public Set<Map.Entry<String,Object>> entrySet()
Specified by:
entrySet in interface Map<String,Object>

clone

public Object clone()
Overrides:
clone in class Object

equals

public boolean equals(Object obj)
Specified by:
equals in interface Map<String,Object>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<String,Object>
Overrides:
hashCode in class Object

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable


Copyright © 2012 Alibaba Group. All Rights Reserved.