1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.json;
16  
17  import java.io.Writer;
18  
19  import java.util.Date;
20  import java.util.Iterator;
21  
22  /**
23   * <a href="JSONObject.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public interface JSONObject {
28  
29      public boolean getBoolean(String key);
30  
31      public double getDouble(String key);
32  
33      public int getInt(String key);
34  
35      public JSONArray getJSONArray(String key);
36  
37      public JSONObject getJSONObject(String key);
38  
39      public long getLong(String key);
40  
41      public String getString(String key);
42  
43      public boolean has(String key);
44  
45      public boolean isNull(String key);
46  
47      public Iterator<String> keys();
48  
49      public int length();
50  
51      public JSONArray names();
52  
53      public JSONObject put(String key, boolean value);
54  
55      public JSONObject put(String key, double value);
56  
57      public JSONObject put(String key, int value);
58  
59      public JSONObject put(String key, long value);
60  
61      public JSONObject put(String key, Date value);
62  
63      public JSONObject put(String key, JSONArray value);
64  
65      public JSONObject put(String key, JSONObject value);
66  
67      public JSONObject put(String key, String value);
68  
69      public Object remove(String key);
70  
71      public String toString();
72  
73      public String toString(int indentFactor) throws JSONException;
74  
75      public Writer write(Writer writer) throws JSONException;
76  
77  }