com.liferay.portal.json
Class JSONObjectImpl

java.lang.Object
  extended by com.liferay.portal.json.JSONObjectImpl
All Implemented Interfaces:
com.liferay.portal.kernel.json.JSONObject

public class JSONObjectImpl
extends java.lang.Object
implements com.liferay.portal.kernel.json.JSONObject

View Source

Author:
Brian Wing Shun Chan

Constructor Summary
JSONObjectImpl()
           
JSONObjectImpl(org.json.JSONObject jsonObj)
           
JSONObjectImpl(com.liferay.portal.kernel.json.JSONObject jsonObj, java.lang.String[] names)
           
JSONObjectImpl(java.util.Map<?,?> map)
           
JSONObjectImpl(java.lang.Object bean)
           
JSONObjectImpl(java.lang.Object obj, java.lang.String[] names)
           
JSONObjectImpl(java.lang.String json)
           
 
Method Summary
 boolean getBoolean(java.lang.String key)
           
 double getDouble(java.lang.String key)
           
 int getInt(java.lang.String key)
           
 com.liferay.portal.kernel.json.JSONArray getJSONArray(java.lang.String key)
           
 org.json.JSONObject getJSONObject()
           
 com.liferay.portal.kernel.json.JSONObject getJSONObject(java.lang.String key)
           
 long getLong(java.lang.String key)
           
 java.lang.String getString(java.lang.String key)
           
 boolean has(java.lang.String key)
           
 boolean isNull(java.lang.String key)
           
 java.util.Iterator<java.lang.String> keys()
           
 int length()
           
 com.liferay.portal.kernel.json.JSONObject put(java.lang.String key, boolean value)
           
 com.liferay.portal.kernel.json.JSONObject put(java.lang.String key, java.util.Date value)
           
 com.liferay.portal.kernel.json.JSONObject put(java.lang.String key, double value)
           
 com.liferay.portal.kernel.json.JSONObject put(java.lang.String key, int value)
           
 com.liferay.portal.kernel.json.JSONObject put(java.lang.String key, com.liferay.portal.kernel.json.JSONArray value)
           
 com.liferay.portal.kernel.json.JSONObject put(java.lang.String key, com.liferay.portal.kernel.json.JSONObject value)
           
 com.liferay.portal.kernel.json.JSONObject put(java.lang.String key, long value)
           
 com.liferay.portal.kernel.json.JSONObject put(java.lang.String key, java.lang.String value)
           
 java.lang.Object remove(java.lang.String key)
           
 java.lang.String toString()
           
 java.lang.String toString(int indentFactor)
           
 java.io.Writer write(java.io.Writer writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSONObjectImpl

public JSONObjectImpl()

JSONObjectImpl

public JSONObjectImpl(com.liferay.portal.kernel.json.JSONObject jsonObj,
                      java.lang.String[] names)
               throws com.liferay.portal.kernel.json.JSONException
Throws:
com.liferay.portal.kernel.json.JSONException

JSONObjectImpl

public JSONObjectImpl(java.util.Map<?,?> map)

JSONObjectImpl

public JSONObjectImpl(java.lang.Object bean)

JSONObjectImpl

public JSONObjectImpl(java.lang.Object obj,
                      java.lang.String[] names)

JSONObjectImpl

public JSONObjectImpl(java.lang.String json)
               throws com.liferay.portal.kernel.json.JSONException
Throws:
com.liferay.portal.kernel.json.JSONException

JSONObjectImpl

public JSONObjectImpl(org.json.JSONObject jsonObj)
Method Detail

getBoolean

public boolean getBoolean(java.lang.String key)
Specified by:
getBoolean in interface com.liferay.portal.kernel.json.JSONObject

getDouble

public double getDouble(java.lang.String key)
Specified by:
getDouble in interface com.liferay.portal.kernel.json.JSONObject

getInt

public int getInt(java.lang.String key)
Specified by:
getInt in interface com.liferay.portal.kernel.json.JSONObject

getJSONArray

public com.liferay.portal.kernel.json.JSONArray getJSONArray(java.lang.String key)
Specified by:
getJSONArray in interface com.liferay.portal.kernel.json.JSONObject

getJSONObject

public org.json.JSONObject getJSONObject()

getJSONObject

public com.liferay.portal.kernel.json.JSONObject getJSONObject(java.lang.String key)
Specified by:
getJSONObject in interface com.liferay.portal.kernel.json.JSONObject

getLong

public long getLong(java.lang.String key)
Specified by:
getLong in interface com.liferay.portal.kernel.json.JSONObject

getString

public java.lang.String getString(java.lang.String key)
Specified by:
getString in interface com.liferay.portal.kernel.json.JSONObject

has

public boolean has(java.lang.String key)
Specified by:
has in interface com.liferay.portal.kernel.json.JSONObject

isNull

public boolean isNull(java.lang.String key)
Specified by:
isNull in interface com.liferay.portal.kernel.json.JSONObject

keys

public java.util.Iterator<java.lang.String> keys()
Specified by:
keys in interface com.liferay.portal.kernel.json.JSONObject

length

public int length()
Specified by:
length in interface com.liferay.portal.kernel.json.JSONObject

put

public com.liferay.portal.kernel.json.JSONObject put(java.lang.String key,
                                                     boolean value)
Specified by:
put in interface com.liferay.portal.kernel.json.JSONObject

put

public com.liferay.portal.kernel.json.JSONObject put(java.lang.String key,
                                                     double value)
Specified by:
put in interface com.liferay.portal.kernel.json.JSONObject

put

public com.liferay.portal.kernel.json.JSONObject put(java.lang.String key,
                                                     int value)
Specified by:
put in interface com.liferay.portal.kernel.json.JSONObject

put

public com.liferay.portal.kernel.json.JSONObject put(java.lang.String key,
                                                     long value)
Specified by:
put in interface com.liferay.portal.kernel.json.JSONObject

put

public com.liferay.portal.kernel.json.JSONObject put(java.lang.String key,
                                                     java.util.Date value)
Specified by:
put in interface com.liferay.portal.kernel.json.JSONObject

put

public com.liferay.portal.kernel.json.JSONObject put(java.lang.String key,
                                                     com.liferay.portal.kernel.json.JSONArray value)
Specified by:
put in interface com.liferay.portal.kernel.json.JSONObject

put

public com.liferay.portal.kernel.json.JSONObject put(java.lang.String key,
                                                     com.liferay.portal.kernel.json.JSONObject value)
Specified by:
put in interface com.liferay.portal.kernel.json.JSONObject

put

public com.liferay.portal.kernel.json.JSONObject put(java.lang.String key,
                                                     java.lang.String value)
Specified by:
put in interface com.liferay.portal.kernel.json.JSONObject

remove

public java.lang.Object remove(java.lang.String key)
Specified by:
remove in interface com.liferay.portal.kernel.json.JSONObject

toString

public java.lang.String toString()
Specified by:
toString in interface com.liferay.portal.kernel.json.JSONObject
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(int indentFactor)
                          throws com.liferay.portal.kernel.json.JSONException
Specified by:
toString in interface com.liferay.portal.kernel.json.JSONObject
Throws:
com.liferay.portal.kernel.json.JSONException

write

public java.io.Writer write(java.io.Writer writer)
                     throws com.liferay.portal.kernel.json.JSONException
Specified by:
write in interface com.liferay.portal.kernel.json.JSONObject
Throws:
com.liferay.portal.kernel.json.JSONException