Online Maps  v3
OnlineMapsJSONObject Class Reference

The wrapper for JSON dictonary. More...

Inheritance diagram for OnlineMapsJSONObject:
OnlineMapsJSONItem

Public Member Functions

 OnlineMapsJSONObject ()
 Constructor More...
 
void Add (string name, OnlineMapsJSONItem value)
 Adds element to the dictionary More...
 
override OnlineMapsJSONItem AppendObject (object obj)
 Serializes the object and adds to the current json node. More...
 
void Combine (OnlineMapsJSONItem other, bool overwriteExistingValues=false)
 Combines two JSON Object. More...
 
override object Deserialize (Type type)
 Deserializes current element More...
 
object Deserialize (Type type, IEnumerable< MemberInfo > members)
 Deserializes current element More...
 
override OnlineMapsJSONItem GetAll (string k)
 Get all elements with the key on the first or the deeper levels of the current element. More...
 
override void ToJSON (StringBuilder b)
 Converts the current and the child elements to JSON string. More...
 
override object Value (Type type)
 Returns the value of the element, converted to the specified type. More...
 
- Public Member Functions inherited from OnlineMapsJSONItem
ChildValue< T > (string childName)
 Returns the value of the child element, converted to the specified type. More...
 
Deserialize< T > ()
 Deserializes current element 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...
 

Static Public Member Functions

static OnlineMapsJSONObject ParseObject (string json)
 Parse a string that contains JSON dictonary More...
 

Properties

Dictionary< string, OnlineMapsJSONItemtable [get]
 Dictionary of items More...
 
- Properties inherited from OnlineMapsJSONItem
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 wrapper for JSON dictonary.

Constructor & Destructor Documentation

◆ OnlineMapsJSONObject()

OnlineMapsJSONObject.OnlineMapsJSONObject ( )

Constructor

Member Function Documentation

◆ Add()

void OnlineMapsJSONObject.Add ( string  name,
OnlineMapsJSONItem  value 
)

Adds element to the dictionary

Parameters
nameKey
valueValue

◆ AppendObject()

override OnlineMapsJSONItem OnlineMapsJSONObject.AppendObject ( object  obj)
virtual

Serializes the object and adds to the current json node.

Parameters
objObject
Returns
Current json node

Reimplemented from OnlineMapsJSONItem.

◆ Combine()

void OnlineMapsJSONObject.Combine ( OnlineMapsJSONItem  other,
bool  overwriteExistingValues = false 
)

Combines two JSON Object.

Parameters
otherOther JSON Object
overwriteExistingValuesOverwrite the existing values?

◆ Deserialize() [1/2]

override object OnlineMapsJSONObject.Deserialize ( Type  type)
virtual

Deserializes current element

Parameters
typeType
Returns
Object

Implements OnlineMapsJSONItem.

◆ Deserialize() [2/2]

object OnlineMapsJSONObject.Deserialize ( Type  type,
IEnumerable< MemberInfo >  members 
)

Deserializes current element

Parameters
typeType
membersMembers of variable
Returns
Object

◆ GetAll()

override OnlineMapsJSONItem OnlineMapsJSONObject.GetAll ( string  key)
virtual

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

Parameters
keyKey
Returns
Elements

Implements OnlineMapsJSONItem.

◆ ParseObject()

static OnlineMapsJSONObject OnlineMapsJSONObject.ParseObject ( string  json)
static

Parse a string that contains JSON dictonary

Parameters
jsonString that contains JSON dictonary
Returns
Instance

◆ ToJSON()

override void OnlineMapsJSONObject.ToJSON ( StringBuilder  b)
virtual

Converts the current and the child elements to JSON string.

Parameters
bStringBuilder instance

Implements OnlineMapsJSONItem.

◆ Value()

override object OnlineMapsJSONObject.Value ( Type  type)
virtual

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

Parameters
typeType of variable
Returns
Value

Implements OnlineMapsJSONItem.

Property Documentation

◆ table

Dictionary<string, OnlineMapsJSONItem> OnlineMapsJSONObject.table
get

Dictionary of items