|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectikrs.json.AbstractJSONValue
ikrs.json.JSONString
public class JSONString
This is the JSON string subclass.
| Field Summary |
|---|
| Fields inherited from interface ikrs.json.JSONValue |
|---|
FALSE, NULL, TRUE, TYPE_ARRAY, TYPE_BOOLEAN, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING |
| Constructor Summary | |
|---|---|
JSONString(java.lang.String string)
Create a new JSON string. |
|
| Method Summary | |
|---|---|
JSONArray |
asJSONArray()
This method tries to convert this JSONValue into a JSONArray. |
JSONBoolean |
asJSONBoolean()
This method tries to convert this JSONValue into a JSONBoolean. |
JSONNumber |
asJSONNumber()
This method tries to convert this JSONValue into a JSONNumber. |
JSONString |
asJSONString()
This method tries to convert this JSONValue into a JSONString. |
java.lang.String |
getString()
Get the string from this JSON value. |
java.lang.String |
toString()
Note: this method does not (!) return a valid JSON string value! |
void |
write(java.io.Writer writer)
This method MUST write a valid JSON value to the passed writer. |
static void |
writeJSON(java.io.Writer writer,
java.lang.String string)
|
| Methods inherited from class ikrs.json.AbstractJSONValue |
|---|
asJSONObject, getArray, getBoolean, getNumber, getObject, getTypeName, isArray, isBoolean, isNull, isNumber, isObject, isString, isValidTypeID, toJSONString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JSONString(java.lang.String string)
throws java.lang.NullPointerException
string - The string value this JSON value should have.
java.lang.NullPointerException| Method Detail |
|---|
public java.lang.String getString()
throws JSONException
getString in interface JSONValuegetString in class AbstractJSONValueJSONException - If this value does not represent a string.
public JSONBoolean asJSONBoolean()
throws JSONException
asJSONBoolean in interface JSONValueasJSONBoolean in class AbstractJSONValueJSONException - If this value is not convertible to a boolean.
public JSONNumber asJSONNumber()
throws JSONException
asJSONNumber in interface JSONValueasJSONNumber in class AbstractJSONValueJSONException - If this value is not convertible to a number.
public JSONString asJSONString()
throws JSONException
asJSONString in interface JSONValueasJSONString in class AbstractJSONValueJSONException - If this value is not convertible to a boolean.
public JSONArray asJSONArray()
throws JSONException
asJSONArray in interface JSONValueasJSONArray in class AbstractJSONValueJSONException - If this value is not convertible to an array.
public void write(java.io.Writer writer)
throws java.io.IOException
write in interface JSONValuewrite in class AbstractJSONValuewriter - The writer to write to.
java.io.IOException - If any IO errors occur.public java.lang.String toString()
toString in class java.lang.Object
public static void writeJSON(java.io.Writer writer,
java.lang.String string)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||