C# OJAI Client API
|
Public Member Functions | |
OjaiDocument () | |
Constructor of OjaiDocument instance. More... | |
OjaiDocument (string jsonString) | |
Constructor of OjaiDocument instance from JSON string. More... | |
OjaiDocument (IDictionary< string, OjaiValue > dictionary) | |
Constructor of OjaiDocument instance from dictionary. More... | |
string | ToJsonString () |
Parse document into JSON string. More... | |
string | ToJsonString (Formatting formatting) |
Parse document into JSON string. More... | |
IDictionary< string, OjaiValue > | ToDictionary () |
Return document as dictionary. More... | |
IDocument | SetID (string value) |
Set string ID of document. More... | |
IDocument | SetID (byte[] value) |
Set binary ID of document. More... | |
IDocument | Set (string path, string value) |
Set string value in document at given path. More... | |
IDocument | Set (string path, bool value) |
Set bool value in document at given path. More... | |
IDocument | Set (string path, byte value) |
Set byte value in document at given path. More... | |
IDocument | Set (string path, short value) |
Set short value in document at given path. More... | |
IDocument | Set (string path, int value) |
Set int value in document at given path. More... | |
IDocument | Set (string path, long value) |
Set long value in document at given path. More... | |
IDocument | Set (string path, float value) |
Set float value in document at given path. More... | |
IDocument | Set (string path, double value) |
Set double value in document at given path. More... | |
IDocument | Set (string path, decimal value) |
Set decimal value in document at given path. More... | |
IDocument | SetNull (string path) |
Set null value in document at given path. More... | |
IDocument | Set (string path, OjaiDate value) |
Set OJAI date value in document at given path. More... | |
IDocument | Set (string path, OjaiTime value) |
Set OJAI time value in document at given path. More... | |
IDocument | Set (string path, OjaiTimestamp value) |
Set OJAI timestamp value in document at given path. More... | |
IDocument | Set (string path, OjaiInterval value) |
Set OJAI interval value in document at given path. More... | |
IDocument | Set (string path, byte[] value) |
Set binary value in document at given path. More... | |
IDocument | SetList (string path, IList< OjaiValue > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< string > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< bool > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< byte > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< short > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< int > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< long > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< float > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< double > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< decimal > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< OjaiDate > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< OjaiTime > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< OjaiTimestamp > value) |
Set IList value in document at given path. More... | |
IDocument | SetList (string path, IList< OjaiInterval > value) |
Set IList value in document at given path. More... | |
IDocument | Set (string path, IDictionary< string, OjaiValue > value) |
Set dictionary value in document at given path. More... | |
IDocument | Set (string path, IDocument value) |
Set document value in document at given path. More... | |
IDocument | Delete (string path) |
Deletes the value at the specified FieldPath if it exists. More... | |
IDocument | DeleteID () |
Deletes the ID field. More... | |
string | GetIdString () |
Returns the String "id" of this document. More... | |
byte [] | GetIdBinary () |
Returns the Binary "id" of this document. More... | |
string | GetString (string path) |
Returns the value at the specified fieldPath as a String object or null if the specified FieldPath does not exist in the document. More... | |
bool? | GetBool (string path) |
Returns the value at the specified fieldPath as a bool object or null if the specified FieldPath does not exist in the document. More... | |
byte? | GetByte (string path) |
Returns the value at the specified fieldPath as a byte object or null if the specified FieldPath does not exist in the document. More... | |
short? | GetShort (string path) |
Returns the value at the specified fieldPath as a short object or null if the specified FieldPath does not exist in the document. More... | |
int? | GetInt (string path) |
Returns the value at the specified fieldPath as a int object or null if the specified FieldPath does not exist in the document. More... | |
long? | GetLong (string path) |
Returns the value at the specified fieldPath as a long object or null if the specified FieldPath does not exist in the document. More... | |
float? | GetFloat (string path) |
Returns the value at the specified fieldPath as a float object or null if the specified FieldPath does not exist in the document. More... | |
double? | GetDouble (string path) |
Returns the value at the specified fieldPath as a double object or null if the specified FieldPath does not exist in the document. More... | |
decimal? | GetDecimal (string path) |
Returns the value at the specified fieldPath as a decimal object or null if the specified FieldPath does not exist in the document. More... | |
OjaiTime | GetTime (string path) |
Returns the value at the specified fieldPath as a OjaiTime object or null if the specified FieldPath does not exist in the document. More... | |
OjaiDate | GetDate (string path) |
Returns the value at the specified fieldPath as an OjaiDate object or null if the specified FieldPath does not exist in the document. More... | |
OjaiTimestamp | GetTimestamp (string path) |
Returns the value at the specified fieldPath as an OjaiTimestamp object or null if the specified FieldPath does not exist in the document. More... | |
byte [] | GetBinary (string path) |
Returns the value at the specified fieldPath as a byte[] object or null if the specified FieldPath does not exist in the document. More... | |
OjaiInterval | GetInterval (string path) |
Returns the value at the specified fieldPath as an OjaiInterval object or null if the specified FieldPath does not exist in the document. More... | |
OjaiValue | GetValue (string path) |
Returns the value at the specified fieldPath as an OjaiValue object or null if the specified FieldPath does not exist in the document. More... | |
IDictionary< string, OjaiValue > | GetDictionary (string path) |
Returns the value at the specified fieldPath as a Dictionary object or null if the specified FieldPath does not exist in the document. More... | |
IList< OjaiValue > | GetList (string path) |
Returns the value at the specified fieldPath as a List object or null if the specified FieldPath does not exist in the document. More... | |
IDocument | Clear () |
Clear document. More... | |
Public Member Functions inherited from MapRDB.Driver.Ojai.IDocument | |
IDocument | Set (string path, Byte[] value) |
Set binary value in document at given path. More... | |
Private Member Functions | |
internal bool | CheckID () |
Check if document has ID. More... | |
void | SetOjai (string path, OjaiValue value) |
Set OJAI value in document at given path. More... | |
bool | SetPath (IDictionary< string, OjaiValue > dictionary, OjaiValue value) |
Recursive method to validate path and set value. More... | |
bool | SetListValue (IList< OjaiValue > list, int index, OjaiValue value) |
Recursive method to validate path and set value. More... | |
T | GetValue< T > (string path) |
Generic method to get value. More... | |
void | GetValue (ref OjaiValue value, IDictionary< string, OjaiValue > dictionary, bool delete=false) |
Recursive method to validate path and get value. More... | |
void | GetListValue (ref OjaiValue value, IList< OjaiValue > list, int index, bool delete) |
Recursive method to validate path and get value. More... | |
T | CheckValue< T > (OjaiValue value) |
Generic method to check value type. More... | |
Queue< string > | ParseFieldPath (string path) |
Parse string path into queue. More... | |
Private Attributes | |
IDictionary< string, OjaiValue > | _internalDictionary |
Regex | _listPathRegex = new Regex("\\w+\\[\\d+\\]", RegexOptions.Compiled) |
Regex | _internalListPathRegex = new Regex("\\w*\\[\\d+\\]", RegexOptions.Compiled) |
Regex | _parsePathRegex = new Regex("(?:^|.)(\"(?:[^\"]+|\"\")*\"|[^.]*)", RegexOptions.Compiled) |
Queue< string > | _parsedPath |
MapRDB.Driver.Ojai.OjaiDocument.OjaiDocument | ( | ) |
Constructor of OjaiDocument instance.
MapRDB.Driver.Ojai.OjaiDocument.OjaiDocument | ( | string | jsonString | ) |
Constructor of OjaiDocument instance from JSON string.
MapRDB.Driver.Ojai.OjaiDocument.OjaiDocument | ( | IDictionary< string, OjaiValue > | dictionary | ) |
Constructor of OjaiDocument instance from dictionary.
|
private |
Check if document has ID.
|
private |
Generic method to check value type.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Clear | ( | ) |
Clear document.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Delete | ( | string | path | ) |
Deletes the value at the specified FieldPath if it exists.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.DeleteID | ( | ) |
Deletes the ID field.
Implements MapRDB.Driver.Ojai.IDocument.
byte [] MapRDB.Driver.Ojai.OjaiDocument.GetBinary | ( | string | path | ) |
Returns the value at the specified fieldPath as a byte[] object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
bool? MapRDB.Driver.Ojai.OjaiDocument.GetBool | ( | string | path | ) |
Returns the value at the specified fieldPath as a bool object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
byte? MapRDB.Driver.Ojai.OjaiDocument.GetByte | ( | string | path | ) |
Returns the value at the specified fieldPath as a byte object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
OjaiDate MapRDB.Driver.Ojai.OjaiDocument.GetDate | ( | string | path | ) |
Returns the value at the specified fieldPath as an OjaiDate object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
decimal? MapRDB.Driver.Ojai.OjaiDocument.GetDecimal | ( | string | path | ) |
Returns the value at the specified fieldPath as a decimal object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
IDictionary<string, OjaiValue> MapRDB.Driver.Ojai.OjaiDocument.GetDictionary | ( | string | path | ) |
Returns the value at the specified fieldPath as a Dictionary object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
double? MapRDB.Driver.Ojai.OjaiDocument.GetDouble | ( | string | path | ) |
Returns the value at the specified fieldPath as a double object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
float? MapRDB.Driver.Ojai.OjaiDocument.GetFloat | ( | string | path | ) |
Returns the value at the specified fieldPath as a float object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
byte [] MapRDB.Driver.Ojai.OjaiDocument.GetIdBinary | ( | ) |
Returns the Binary "id" of this document.
Implements MapRDB.Driver.Ojai.IDocument.
string MapRDB.Driver.Ojai.OjaiDocument.GetIdString | ( | ) |
Returns the String "id" of this document.
Implements MapRDB.Driver.Ojai.IDocument.
int? MapRDB.Driver.Ojai.OjaiDocument.GetInt | ( | string | path | ) |
Returns the value at the specified fieldPath as a int object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
OjaiInterval MapRDB.Driver.Ojai.OjaiDocument.GetInterval | ( | string | path | ) |
Returns the value at the specified fieldPath as an OjaiInterval object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
IList<OjaiValue> MapRDB.Driver.Ojai.OjaiDocument.GetList | ( | string | path | ) |
Returns the value at the specified fieldPath as a List object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
|
private |
Recursive method to validate path and get value.
long? MapRDB.Driver.Ojai.OjaiDocument.GetLong | ( | string | path | ) |
Returns the value at the specified fieldPath as a long object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
short? MapRDB.Driver.Ojai.OjaiDocument.GetShort | ( | string | path | ) |
Returns the value at the specified fieldPath as a short object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
string MapRDB.Driver.Ojai.OjaiDocument.GetString | ( | string | path | ) |
Returns the value at the specified fieldPath as a String object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
OjaiTime MapRDB.Driver.Ojai.OjaiDocument.GetTime | ( | string | path | ) |
Returns the value at the specified fieldPath as a OjaiTime object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
OjaiTimestamp MapRDB.Driver.Ojai.OjaiDocument.GetTimestamp | ( | string | path | ) |
Returns the value at the specified fieldPath as an OjaiTimestamp object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
OjaiValue MapRDB.Driver.Ojai.OjaiDocument.GetValue | ( | string | path | ) |
Returns the value at the specified fieldPath as an OjaiValue object or null if the specified FieldPath does not exist in the document.
Implements MapRDB.Driver.Ojai.IDocument.
|
private |
Recursive method to validate path and get value.
|
private |
Generic method to get value.
|
private |
Parse string path into queue.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
string | value | ||
) |
Set string value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
bool | value | ||
) |
Set bool value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
byte | value | ||
) |
Set byte value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
short | value | ||
) |
Set short value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
int | value | ||
) |
Set int value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
long | value | ||
) |
Set long value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
float | value | ||
) |
Set float value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
double | value | ||
) |
Set double value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
decimal | value | ||
) |
Set decimal value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
Set OJAI date value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
Set OJAI time value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
OjaiTimestamp | value | ||
) |
Set OJAI timestamp value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
OjaiInterval | value | ||
) |
Set OJAI interval value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
byte [] | value | ||
) |
Set binary value in document at given path.
IDocument MapRDB.Driver.Ojai.OjaiDocument.Set | ( | string | path, |
IDictionary< string, OjaiValue > | value | ||
) |
Set dictionary value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
Set document value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetID | ( | string | value | ) |
Set string ID of document.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetID | ( | byte [] | value | ) |
Set binary ID of document.
Implements MapRDB.Driver.Ojai.IDocument.
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< string > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< bool > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< byte > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< short > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< int > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< long > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< float > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< double > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< decimal > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< OjaiTimestamp > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetList | ( | string | path, |
IList< OjaiInterval > | value | ||
) |
Set IList value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
|
private |
Recursive method to validate path and set value.
IDocument MapRDB.Driver.Ojai.OjaiDocument.SetNull | ( | string | path | ) |
Set null value in document at given path.
Implements MapRDB.Driver.Ojai.IDocument.
|
private |
Set OJAI value in document at given path.
|
private |
Recursive method to validate path and set value.
IDictionary<string, OjaiValue> MapRDB.Driver.Ojai.OjaiDocument.ToDictionary | ( | ) |
Return document as dictionary.
Implements MapRDB.Driver.Ojai.IDocument.
string MapRDB.Driver.Ojai.OjaiDocument.ToJsonString | ( | ) |
Parse document into JSON string.
Implements MapRDB.Driver.Ojai.IDocument.
string MapRDB.Driver.Ojai.OjaiDocument.ToJsonString | ( | Formatting | formatting | ) |
Parse document into JSON string.
Implements MapRDB.Driver.Ojai.IDocument.