Class JSONObjectImpl

Object
com.liferay.portal.json.JSONObjectImpl
All Implemented Interfaces:
com.liferay.portal.kernel.json.JSONObject, com.liferay.portal.kernel.json.JSONSerializable, Externalizable, Serializable
Direct Known Subclasses:
UnmodifiableJSONObjectImpl

public class JSONObjectImpl extends Object implements com.liferay.portal.kernel.json.JSONObject
Author:
Brian Wing Shun Chan
See Also:
  • Constructor Details

    • JSONObjectImpl

      public JSONObjectImpl()
    • JSONObjectImpl

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

      public JSONObjectImpl(org.json.JSONObject jsonObject)
    • JSONObjectImpl

      public JSONObjectImpl(Map<?,?> map)
    • JSONObjectImpl

      public JSONObjectImpl(Object bean)
    • JSONObjectImpl

      public JSONObjectImpl(Object object, String[] names)
    • JSONObjectImpl

      public JSONObjectImpl(String json) throws com.liferay.portal.kernel.json.JSONException
      Throws:
      com.liferay.portal.kernel.json.JSONException
  • Method Details

    • get

      public Object get(String key)
      Specified by:
      get in interface com.liferay.portal.kernel.json.JSONObject
    • getBoolean

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

      public boolean getBoolean(String key, boolean defaultValue)
      Specified by:
      getBoolean in interface com.liferay.portal.kernel.json.JSONObject
    • getDouble

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

      public double getDouble(String key, double defaultValue)
      Specified by:
      getDouble in interface com.liferay.portal.kernel.json.JSONObject
    • getInt

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

      public int getInt(String key, int defaultValue)
      Specified by:
      getInt in interface com.liferay.portal.kernel.json.JSONObject
    • getJSONArray

      public com.liferay.portal.kernel.json.JSONArray getJSONArray(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(String key)
      Specified by:
      getJSONObject in interface com.liferay.portal.kernel.json.JSONObject
    • getLong

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

      public long getLong(String key, long defaultValue)
      Specified by:
      getLong in interface com.liferay.portal.kernel.json.JSONObject
    • getString

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

      public String getString(String key, String defaultValue)
      Specified by:
      getString in interface com.liferay.portal.kernel.json.JSONObject
    • has

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

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

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

      public Set<String> keySet()
      Specified by:
      keySet in interface com.liferay.portal.kernel.json.JSONObject
    • length

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

      public com.liferay.portal.kernel.json.JSONArray names()
      Specified by:
      names in interface com.liferay.portal.kernel.json.JSONObject
    • opt

      public Object opt(String key)
      Specified by:
      opt in interface com.liferay.portal.kernel.json.JSONObject
    • put

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

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

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

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

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

      public com.liferay.portal.kernel.json.JSONObject put(String key, com.liferay.portal.kernel.json.JSONObject jsonObject)
      Specified by:
      put in interface com.liferay.portal.kernel.json.JSONObject
    • put

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

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

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

      public com.liferay.portal.kernel.json.JSONObject put(String key, com.liferay.petra.function.UnsafeSupplier<Object,Exception> valueUnsafeSupplier)
      Specified by:
      put in interface com.liferay.portal.kernel.json.JSONObject
    • putException

      public com.liferay.portal.kernel.json.JSONObject putException(Exception exception1)
      Specified by:
      putException in interface com.liferay.portal.kernel.json.JSONObject
    • readExternal

      public void readExternal(ObjectInput objectInput) throws IOException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
    • remove

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

      public String toJSONString()
      Specified by:
      toJSONString in interface com.liferay.portal.kernel.json.JSONSerializable
    • toMap

      public Map<String,Object> toMap()
      Specified by:
      toMap in interface com.liferay.portal.kernel.json.JSONObject
    • toString

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

      public 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 Writer write(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
    • writeExternal

      public void writeExternal(ObjectOutput objectOutput) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException