1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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 JSONObject put(String key, boolean value);
52  
53      public JSONObject put(String key, double value);
54  
55      public JSONObject put(String key, int value);
56  
57      public JSONObject put(String key, long value);
58  
59      public JSONObject put(String key, Date value);
60  
61      public JSONObject put(String key, JSONArray value);
62  
63      public JSONObject put(String key, JSONObject value);
64  
65      public JSONObject put(String key, String value);
66  
67      public Object remove(String key);
68  
69      public String toString();
70  
71      public String toString(int indentFactor) throws JSONException;
72  
73      public Writer write(Writer writer) throws JSONException;
74  
75  }