org.xerial.json
Class JSONWriter
java.lang.Object
org.xerial.json.JSONWriter
public class JSONWriter
- extends Object
A support class for generating JSON data
- Author:
- leo
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JSONWriter
public JSONWriter(Writer writer)
startObject
public void startObject()
throws IOException
- Throws:
IOException
endObject
public void endObject()
throws IOException,
JSONException
- Throws:
IOException
JSONException
startArray
public void startArray()
throws IOException
- Throws:
IOException
endArray
public void endArray()
throws IOException,
JSONException
- Throws:
IOException
JSONException
startString
public void startString()
throws JSONException,
IOException
- Throws:
JSONException
IOException
startString
public void startString(String key)
throws JSONException,
IOException
- Throws:
JSONException
IOException
append
public void append(String stringFragment)
throws JSONException,
IOException
- Throws:
JSONException
IOException
endString
public void endString()
throws JSONException,
IOException
- Throws:
JSONException
IOException
startArray
public void startArray(String key)
throws JSONException,
IOException
- Throws:
JSONException
IOException
add
public void add(String value)
throws IOException
- Throws:
IOException
add
public void add(int value)
throws IOException
- Throws:
IOException
add
public void add(long value)
throws IOException
- Throws:
IOException
add
public void add(double value)
throws IOException
- Throws:
IOException
add
public void add(float value)
throws IOException
- Throws:
IOException
add
public void add(boolean bool)
throws IOException
- Throws:
IOException
put
public void put(String key,
String value)
throws IOException,
JSONException
- Throws:
IOException
JSONException
put
public void put(String key,
int value)
throws JSONException,
IOException
- Throws:
JSONException
IOException
put
public void put(String key,
float value)
throws JSONException,
IOException
- Throws:
JSONException
IOException
put
public void put(String key,
double value)
throws JSONException,
IOException
- Throws:
JSONException
IOException
put
public void put(String key,
long value)
throws JSONException,
IOException
- Throws:
JSONException
IOException
put
public void put(String key,
boolean value)
throws JSONException,
IOException
- Throws:
JSONException
IOException
putNull
public void putNull(String key)
throws JSONException,
IOException
- Throws:
JSONException
IOException
putString
public void putString(String key,
Reader input)
throws JSONException,
IOException
- Generate the key/value pair from the
Reader
- Parameters:
key - input -
- Throws:
IOException
JSONException
flush
public void flush()
throws IOException
- Throws:
IOException
endJSON
public void endJSON()
throws IOException
- Throws:
IOException
getWriter
public Writer getWriter()

This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.