|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.javajson.JsonValue
public class JsonValue
Constructor Summary | |
---|---|
JsonValue()
|
|
JsonValue(boolean val)
|
|
JsonValue(double val)
|
|
JsonValue(float val)
|
|
JsonValue(int val)
|
|
JsonValue(JsonArray val)
|
|
JsonValue(JsonObject val)
|
|
JsonValue(long val)
|
|
JsonValue(Object val)
|
|
JsonValue(String val)
|
Method Summary | |
---|---|
static String |
byteToHex(byte b)
|
static String |
charToEscaped(char c)
|
static String |
escape(String str)
Escapes strings for toString |
boolean |
getBoolean()
|
double |
getDouble()
|
float |
getFloat()
|
int |
getInt()
|
JsonArray |
getJsonArray()
|
JsonObject |
getJsonObject()
|
long |
getLong()
|
JsonNativeType |
getNativeType()
|
String |
getString()
|
Class |
getValueClass()
Deprecated. User getNativeType instead |
boolean |
isBoolean()
Checks if the value is a boolean |
boolean |
isDouble()
Checks if the value can be safely converted to this type without losing data. |
boolean |
isFloat()
Checks if the value can be safely converted to this type without losing. |
boolean |
isInt()
Checks if the value can be safely converted to this type without losing data. |
boolean |
isJsonArray()
|
boolean |
isJsonObject()
|
boolean |
isLong()
Checks if the value can be safely converted to this type without losing data |
boolean |
isNull()
|
boolean |
isSimilar(JsonValue obj)
Checks if the type of this value is similar to that of another value. |
boolean |
isString()
Returns true if the value is a number, boolean or string |
void |
setBoolean(boolean b)
|
void |
setDouble(double d)
|
void |
setFloat(float f)
|
void |
setInt(int i)
|
void |
setJsonArray(JsonArray array)
|
void |
setJsonObject(JsonObject object)
|
void |
setLong(long l)
|
protected void |
setNull()
Just sets the value to null |
void |
setString(String s)
|
String |
toString()
|
protected String |
toString(int spacing,
int margin)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JsonValue()
public JsonValue(boolean val)
public JsonValue(double val)
public JsonValue(float val)
public JsonValue(int val)
public JsonValue(JsonArray val)
public JsonValue(JsonObject val)
public JsonValue(long val)
public JsonValue(String val)
public JsonValue(Object val)
Method Detail |
---|
public static String byteToHex(byte b)
public static String charToEscaped(char c)
public boolean getBoolean()
public double getDouble()
public float getFloat()
public int getInt()
public JsonArray getJsonArray()
public JsonObject getJsonObject()
public long getLong()
public String getString()
public Class getValueClass()
public JsonNativeType getNativeType()
public boolean isBoolean()
public boolean isDouble()
public boolean isFloat()
public boolean isInt()
public boolean isJsonArray()
public boolean isJsonObject()
public boolean isLong()
public boolean isNull()
public boolean isSimilar(JsonValue obj)
obj
-
public boolean isString()
public void setBoolean(boolean b)
public void setDouble(double d)
public void setFloat(float f)
public void setInt(int i)
public void setJsonArray(JsonArray array)
public void setJsonObject(JsonObject object)
public void setLong(long l)
protected void setNull()
public void setString(String s)
public static String escape(String str)
str
-
public String toString()
toString
in class Object
protected String toString(int spacing, int margin)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |