JsonValue Class Methods
In this section, the JsonValue class methods are presented in alphabetical order.
Syntax
GetBoolean()
Description
Use this method to return a Boolean value of the object.
Parameters
None.
Returns
Boolean.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetBoolean( True);
Local Boolean &jValBool = &jVal.GetBoolean();
Syntax
GetDate()
Description
Use this method to return date value of the object.
Parameters
None.
Returns
Date.
Example
Local date &dt = Date(20000101);
&jVal.SetDate(&dt);
Local date &jValDt = &jVal.GetDate();
Syntax
GetDateTime()
Description
Use this method to return datetime value of the object.
Parameters
None.
Returns
DateTime.
Example
Local datetime &dttm = DateTime6(2000, 1, 1, 1, 5, 7);
&jVal.SetDateTime(&dttm);
Local datetime &jValDtTm = &jVal.GetDateTime();
Syntax
GetInteger()
Description
Use this method to return integer value of the object.
Parameters
None.
Returns
Integer.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetInteger(5);
Local integer &jValInt = &jVal.GetInteger();
Syntax
GetNumber()
Description
Use this method to return number value of the object.
Parameters
None.
Returns
Number.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetNumber(5);
Local Number &jValNum = &jVal.GetNumber();
Syntax
GetString()
Description
Use this method to return string value of the object.
Parameters
None.
Returns
String.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetString("Test String");
Local string &jValStr = &jVal.GetString();
Syntax
GetTime()
Description
Use this method to return time value of the object.
Parameters
None.
Returns
Time.
Example
Local time &tm = Time(10507);
&jVal.SetTime(&tm);
Local time &jValTime = &jVal.GetTime();
Syntax
GetValue()
Description
Use this method to return the value of the object.
Parameters
None.
Returns
Any.
Example
Local datetime &dttm = DateTime6(2000, 1, 1, 1, 5, 7);
&jVal.SetDateTime(&dttm);
Local any &jValAny = &jVal.GetValue();
Syntax
IsNull()
Description
Use this method to check whether the value of the object is null.
Parameters
None.
Returns
Boolean.
Example
Local JsonValue &jVal = CreateJsonValue();
Local boolean &bIsNull = &jVal.IsNull();
Syntax
SetBoolean(Value)
Description
Use this method to set the Boolean value of the object.
Parameters
Field or Control |
Definition |
---|---|
Value |
Specifies a Boolean value. |
Returns
None.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetBoolean(True);
Syntax
SetDate(Date)
Description
Use this method to set the date value of the object.
Parameters
Field or Control |
Definition |
---|---|
Date |
Specifies a date value. |
Returns
None.
Example
Local JsonValue &jVal = CreateJsonValue();
Local date &dt = Date(20000101);
&jVal.SetDate(&dt);
Syntax
SetDateTime(Date_time)
Description
Use this method to set the datetime value of the object.
Parameters
Field or Control |
Definition |
---|---|
Date_time |
Specifies a datetime value. |
Returns
None.
Example
Local JsonValue &jVal = CreateJsonValue();
Local datetime &dttm = DateTime6(2000, 1, 1, 1, 5, 7);
&jVal.SetDateTime(&dttm);
Syntax
SetFalse()
Description
Use this method to set the value of the object to false.
Parameters
None.
Returns
None.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetFalse();
Syntax
SetInteger(Value)
Description
Use this method to set the integer value of the object.
Parameters
Field or Control |
Definition |
---|---|
Value |
Specifies an integer value. |
Returns
None.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetInteger(5);
Syntax
SetNull()
Description
Use this method to set the value of the object to null.
Parameters
None.
Returns
None.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetNull();
Syntax
SetNumber(Value)
Description
Use this method to set the number value of the object.
Parameters
Field or Control |
Definition |
---|---|
Value |
Specifies a number value. |
Returns
None.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetNumber(5);
Syntax
SetString(Value)
Description
Use this method to set the string value of the object.
Parameters
Field or Control |
Definition |
---|---|
Value |
Specifies a string value. |
Returns
None.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetString("Test String");
Syntax
SetTrue()
Description
Use this method to set the value of the object to true.
Parameters
None.
Returns
None.
Example
Local JsonValue &jVal = CreateJsonValue();
&jVal.SetTrue();
Syntax
ToString()
Description
Use this method to serialize the Json value object to a string.
Parameters
None.
Returns
String.
Example
Local JsonValue &jVal = CreateJsonValue();
Local datetime &dttm = DateTime6(2000, 1, 1, 1, 5, 7);
&jVal.SetDateTime(&dttm);
Local string &jValToString = &jVal.ToString();