Online Maps  v3
OnlineMapsJSONItem Class Referenceabstract

The base class of JSON elements. More...

Inheritance diagram for OnlineMapsJSONItem:
OnlineMapsJSONArray OnlineMapsJSONObject OnlineMapsJSONValue

Public Member Functions

virtual OnlineMapsJSONItem AppendObject (object obj)
 Serializes the object and adds to the current json node. More...
 
ChildValue< T > (string childName)
 Returns the value of the child element, converted to the specified type. More...
 
Deserialize< T > ()
 Deserializes current element More...
 
abstract object Deserialize (Type type)
 Deserializes current element More...
 
abstract OnlineMapsJSONItem GetAll (string key)
 Get all elements with the key on the first or the deeper levels of the current element. More...
 
abstract void ToJSON (StringBuilder b)
 Converts the current and the child elements to JSON string. More...
 
abstract object Value (Type type)
 Returns the value of the element, converted to the specified type. More...
 
virtual T Value< T > ()
 Returns the value of the element, converted to the specified type. More...
 
V< T > ()
 Returns the value of the element, converted to the specified type. More...
 
V< T > (string childName)
 Returns the value of the child element, converted to the specified type. More...
 

Properties

abstract OnlineMapsJSONItem this[int index] [get]
 Get the element by index More...
 
abstract OnlineMapsJSONItem this[string key] [get]
 Get the element by key.
Supports XPath like selectors:
["key"] - get element by key.
["key1/key2"] - get element key2, which is a child of the element key1.
["key/N"] - where N is number. Get array element by index N, which is a child of the element key1.
["key/*"] - get all array elements, which is a child of the element key1.
["//key"] - get all elements with the key on the first or the deeper levels of the current element.
More...
 

Detailed Description

The base class of JSON elements.

Member Function Documentation

◆ AppendObject()

virtual OnlineMapsJSONItem OnlineMapsJSONItem.AppendObject ( object  obj)
virtual

Serializes the object and adds to the current json node.

Parameters
objObject
Returns
Current json node

Reimplemented in OnlineMapsJSONObject.

◆ ChildValue< T >()

T OnlineMapsJSONItem.ChildValue< T > ( string  childName)

Returns the value of the child element, converted to the specified type.

Template Parameters
TType of variable
Parameters
childNameChild element key
Returns
Value

◆ Deserialize()

abstract object OnlineMapsJSONItem.Deserialize ( Type  type)
pure virtual

Deserializes current element

Parameters
typeType
Returns
Object

Implemented in OnlineMapsJSONValue, OnlineMapsJSONObject, and OnlineMapsJSONArray.

◆ Deserialize< T >()

Deserializes current element

Template Parameters
TType
Returns
Object

◆ GetAll()

abstract OnlineMapsJSONItem OnlineMapsJSONItem.GetAll ( string  key)
pure virtual

Get all elements with the key on the first or the deeper levels of the current element.

Parameters
keyKey
Returns
Elements

Implemented in OnlineMapsJSONValue, OnlineMapsJSONObject, and OnlineMapsJSONArray.

◆ ToJSON()

abstract void OnlineMapsJSONItem.ToJSON ( StringBuilder  b)
pure virtual

Converts the current and the child elements to JSON string.

Parameters
bStringBuilder instance

Implemented in OnlineMapsJSONValue, OnlineMapsJSONObject, and OnlineMapsJSONArray.

◆ V< T >() [1/2]

T OnlineMapsJSONItem.V< T > ( )

Returns the value of the element, converted to the specified type.

Template Parameters
TType of variable
Returns
Value

◆ V< T >() [2/2]

T OnlineMapsJSONItem.V< T > ( string  childName)

Returns the value of the child element, converted to the specified type.

Template Parameters
TType of variable
Parameters
childNameChild element key
Returns
Value

◆ Value()

abstract object OnlineMapsJSONItem.Value ( Type  type)
pure virtual

Returns the value of the element, converted to the specified type.

Parameters
typeType of variable
Returns
Value

Implemented in OnlineMapsJSONObject, OnlineMapsJSONArray, and OnlineMapsJSONValue.

◆ Value< T >()

virtual T OnlineMapsJSONItem.Value< T > ( )
virtual

Returns the value of the element, converted to the specified type.

Template Parameters
TType of variable
Returns
Value

Property Documentation

◆ this[int index]

abstract OnlineMapsJSONItem OnlineMapsJSONItem.this[int index]
get

Get the element by index

Parameters
indexIndex of element
Returns
Element

◆ this[string key]

abstract OnlineMapsJSONItem OnlineMapsJSONItem.this[string key]
get

Get the element by key.
Supports XPath like selectors:
["key"] - get element by key.
["key1/key2"] - get element key2, which is a child of the element key1.
["key/N"] - where N is number. Get array element by index N, which is a child of the element key1.
["key/*"] - get all array elements, which is a child of the element key1.
["//key"] - get all elements with the key on the first or the deeper levels of the current element.

Parameters
keyElement key
Returns
Element