com.liferay.portal.json
Class JSONObjectImpl
java.lang.Object
com.liferay.portal.json.JSONObjectImpl
- All Implemented Interfaces:
- JSONObject
public class JSONObjectImpl
- extends Object
- implements JSONObject
Method Summary |
boolean |
getBoolean(String key)
|
boolean |
getBoolean(String key,
boolean defaultValue)
|
double |
getDouble(String key)
|
double |
getDouble(String key,
double defaultValue)
|
int |
getInt(String key)
|
int |
getInt(String key,
int defaultValue)
|
JSONArray |
getJSONArray(String key)
|
org.json.JSONObject |
getJSONObject()
|
JSONObject |
getJSONObject(String key)
|
long |
getLong(String key)
|
long |
getLong(String key,
long defaultValue)
|
String |
getString(String key)
|
String |
getString(String key,
String defaultValue)
|
boolean |
has(String key)
|
boolean |
isNull(String key)
|
Iterator<String> |
keys()
|
int |
length()
|
JSONArray |
names()
|
JSONObject |
put(String key,
boolean value)
|
JSONObject |
put(String key,
Date value)
|
JSONObject |
put(String key,
double value)
|
JSONObject |
put(String key,
int value)
|
JSONObject |
put(String key,
JSONArray value)
|
JSONObject |
put(String key,
JSONObject value)
|
JSONObject |
put(String key,
long value)
|
JSONObject |
put(String key,
String value)
|
JSONObject |
putException(Exception exception)
|
Object |
remove(String key)
|
String |
toString()
|
String |
toString(int indentFactor)
|
Writer |
write(Writer writer)
|
JSONObjectImpl
public JSONObjectImpl()
JSONObjectImpl
public JSONObjectImpl(JSONObject jsonObject,
String[] names)
throws JSONException
- Throws:
JSONException
JSONObjectImpl
public JSONObjectImpl(Map<?,?> map)
JSONObjectImpl
public JSONObjectImpl(Object bean)
JSONObjectImpl
public JSONObjectImpl(Object obj,
String[] names)
JSONObjectImpl
public JSONObjectImpl(org.json.JSONObject jsonObj)
JSONObjectImpl
public JSONObjectImpl(String json)
throws JSONException
- Throws:
JSONException
getBoolean
public boolean getBoolean(String key)
- Specified by:
getBoolean
in interface JSONObject
getBoolean
public boolean getBoolean(String key,
boolean defaultValue)
- Specified by:
getBoolean
in interface JSONObject
getDouble
public double getDouble(String key)
- Specified by:
getDouble
in interface JSONObject
getDouble
public double getDouble(String key,
double defaultValue)
- Specified by:
getDouble
in interface JSONObject
getInt
public int getInt(String key)
- Specified by:
getInt
in interface JSONObject
getInt
public int getInt(String key,
int defaultValue)
- Specified by:
getInt
in interface JSONObject
getJSONArray
public JSONArray getJSONArray(String key)
- Specified by:
getJSONArray
in interface JSONObject
getJSONObject
public org.json.JSONObject getJSONObject()
getJSONObject
public JSONObject getJSONObject(String key)
- Specified by:
getJSONObject
in interface JSONObject
getLong
public long getLong(String key)
- Specified by:
getLong
in interface JSONObject
getLong
public long getLong(String key,
long defaultValue)
- Specified by:
getLong
in interface JSONObject
getString
public String getString(String key)
- Specified by:
getString
in interface JSONObject
getString
public String getString(String key,
String defaultValue)
- Specified by:
getString
in interface JSONObject
has
public boolean has(String key)
- Specified by:
has
in interface JSONObject
isNull
public boolean isNull(String key)
- Specified by:
isNull
in interface JSONObject
keys
public Iterator<String> keys()
- Specified by:
keys
in interface JSONObject
length
public int length()
- Specified by:
length
in interface JSONObject
names
public JSONArray names()
- Specified by:
names
in interface JSONObject
put
public JSONObject put(String key,
boolean value)
- Specified by:
put
in interface JSONObject
put
public JSONObject put(String key,
Date value)
- Specified by:
put
in interface JSONObject
put
public JSONObject put(String key,
double value)
- Specified by:
put
in interface JSONObject
put
public JSONObject put(String key,
int value)
- Specified by:
put
in interface JSONObject
put
public JSONObject put(String key,
JSONArray value)
- Specified by:
put
in interface JSONObject
put
public JSONObject put(String key,
JSONObject value)
- Specified by:
put
in interface JSONObject
put
public JSONObject put(String key,
long value)
- Specified by:
put
in interface JSONObject
put
public JSONObject put(String key,
String value)
- Specified by:
put
in interface JSONObject
putException
public JSONObject putException(Exception exception)
- Specified by:
putException
in interface JSONObject
remove
public Object remove(String key)
- Specified by:
remove
in interface JSONObject
toString
public String toString()
- Specified by:
toString
in interface JSONObject
- Overrides:
toString
in class Object
toString
public String toString(int indentFactor)
throws JSONException
- Specified by:
toString
in interface JSONObject
- Throws:
JSONException
write
public Writer write(Writer writer)
throws JSONException
- Specified by:
write
in interface JSONObject
- Throws:
JSONException