|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.json.AbstractJSONValue ikrs.json.JSONBoolean
public class JSONBoolean
This is the JSON boolean 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 | |
---|---|
JSONBoolean(java.lang.Boolean bool)
Create a new JSON boolean. |
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. |
JSONString |
asJSONString()
This method tries to convert this JSONValue into a JSONString. |
java.lang.Boolean |
getBoolean()
Get the boolean from this JSON value. |
static java.lang.Boolean |
parseBoolean(java.lang.String str,
boolean caseSensitive)
This static method is the equivalent to Java's Boolean.parseBoolean(String). |
static JSONBoolean |
parseJSONBoolean(java.lang.String str,
boolean caseSensitive)
This static method is the equivalent to Java's Boolean.parseBoolean(String). |
java.lang.String |
toString()
|
void |
write(java.io.Writer writer)
This method MUST write a valid JSON value to the passed writer. |
Methods inherited from class ikrs.json.AbstractJSONValue |
---|
asJSONNumber, asJSONObject, getArray, getNumber, getObject, getString, 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 JSONBoolean(java.lang.Boolean bool) throws java.lang.NullPointerException
bool
- The boolean value this JSON value should have.
java.lang.NullPointerException
Method Detail |
---|
public java.lang.Boolean getBoolean() throws JSONException
getBoolean
in interface JSONValue
getBoolean
in class AbstractJSONValue
JSONException
- If this value does not represent a boolean value.public JSONBoolean asJSONBoolean() throws JSONException
asJSONBoolean
in interface JSONValue
asJSONBoolean
in class AbstractJSONValue
JSONException
- If this value is not convertible to a boolean.public JSONString asJSONString() throws JSONException
asJSONString
in interface JSONValue
asJSONString
in class AbstractJSONValue
JSONException
- If this value is not convertible to a boolean.public JSONArray asJSONArray() throws JSONException
asJSONArray
in interface JSONValue
asJSONArray
in class AbstractJSONValue
JSONException
- If this value is not convertible to an array.public void write(java.io.Writer writer) throws java.io.IOException
write
in interface JSONValue
write
in class AbstractJSONValue
writer
- 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 java.lang.Boolean parseBoolean(java.lang.String str, boolean caseSensitive) throws java.lang.NullPointerException, java.lang.NumberFormatException
str
- The string to be parsed.
java.lang.NullPointerException
- If the passed string is null.
JSONException
- If the passed string does not represent a boolean.
java.lang.NumberFormatException
public static JSONBoolean parseJSONBoolean(java.lang.String str, boolean caseSensitive) throws java.lang.NullPointerException, JSONException
str
- The string to be parsed.
java.lang.NullPointerException
- If the passed string is null.
JSONException
- If the passed string does not represent a number.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |