/// <summary> /// Creates a proper FCL factory for given numer formatting parsing. /// </summary> internal static IObjectFactory Create(JSonReaderNumberFormat format) { switch(format) { case JSonReaderNumberFormat.Default: return new JSonObjectFactory(); case JSonReaderNumberFormat.AsInt32: return new JSonObjectInt32Factory(); case JSonReaderNumberFormat.AsInt64: return new JSonObjectInt64Factory(); case JSonReaderNumberFormat.AsDouble: return new JSonObjectDoubleFactory(); case JSonReaderNumberFormat.AsDecimal: return new JSonObjectDecimalFactory(); default: throw new ArgumentOutOfRangeException("format", string.Concat("Unsupported number reading format (", format, ")")); } }
/// <summary> /// Creates a proper FCL factory for given numer formatting parsing. /// </summary> internal static IObjectFactory Create(JSonReaderNumberFormat format) { switch (format) { case JSonReaderNumberFormat.Default: return(new JSonObjectFactory()); case JSonReaderNumberFormat.AsInt32: return(new JSonObjectInt32Factory()); case JSonReaderNumberFormat.AsInt64: return(new JSonObjectInt64Factory()); case JSonReaderNumberFormat.AsDouble: return(new JSonObjectDoubleFactory()); case JSonReaderNumberFormat.AsDecimal: return(new JSonObjectDecimalFactory()); default: throw new ArgumentOutOfRangeException("format", string.Concat("Unsupported number reading format (", format, ")")); } }
/// <summary> /// Converts a JSON string from given input into a tree of JSON-specific objects. /// It then allows easier deserialization for objects implementing <see cref="IJSonMutableObject"/> interface as those objects expose /// more functionality then the standard .NET ones. /// </summary> public IJSonMutableObject ReadAsJSonMutableObject(JSonReaderNumberFormat format) { // numerical formats are ignored as the BSON-spec defines them clearly: return ReadAsJSonMutableObject(); }
/// <summary> /// Converts a JSON string from given input into a tree of .NET arrays, dictionaries, strings and decimals. /// </summary> public object Read(JSonReaderNumberFormat format) { // numerical formats are ignored as the BSON-spec defines them clearly: return Read(); }
protected JSonObjectFactory(JSonReaderNumberFormat format) { Format = format; }
/// <summary> /// Converts a JSON string from given input into a tree of JSON-specific objects. /// It then allows easier deserialization for objects implementing <see cref="IJSonMutableObject"/> interface as those objects expose /// more functionality then the standard .NET ones. /// </summary> public IJSonMutableObject ReadAsJSonMutableObject(TextReader input, JSonReaderNumberFormat format) { SetSource(input); Reset(JSonMutableObjectFactory.Create(format)); return ReadInput() as IJSonMutableObject; }
/// <summary> /// Converts a JSON string from given input into a tree of .NET arrays, dictionaries, strings and decimals. /// </summary> public object Read(TextReader input, JSonReaderNumberFormat format) { SetSource(input); Reset(FclObjectFactory.Create(format)); return ReadInput(); }
/// <summary> /// Converts a JSON string from given input into a tree of JSON-specific objects. /// It then allows easier deserialization for objects implementing <see cref="IJSonMutableObject"/> interface as those objects expose /// more functionality then the standard .NET ones. /// </summary> public IJSonMutableObject ReadAsJSonMutableObject(JSonReaderNumberFormat format) { Reset(JSonMutableObjectFactory.Create(format)); return ReadInput() as IJSonMutableObject; }
/// <summary> /// Converts a JSON string from given input into a tree of JSON-specific objects. /// It then allows easier deserialization for objects implementing <see cref="IJSonMutableObject"/> interface as those objects expose /// more functionality then the standard .NET ones. /// </summary> public IJSonMutableObject ReadAsJSonMutableObject(TextReader input, JSonReaderNumberFormat format) { SetSource(input); Reset(JSonMutableObjectFactory.Create(format)); return(ReadInput() as IJSonMutableObject); }
/// <summary> /// Converts a JSON string from given input into a tree of .NET arrays, dictionaries, strings and decimals. /// </summary> public object Read(JSonReaderNumberFormat format) { Reset(FclObjectFactory.Create(format)); return ReadInput(); }
/// <summary> /// Converts a JSON string from given input into a tree of JSON-specific objects. /// It then allows easier deserialization for objects implementing <see cref="IJSonMutableObject"/> interface as those objects expose /// more functionality then the standard .NET ones. /// </summary> public IJSonMutableObject ReadAsJSonMutableObject(JSonReaderNumberFormat format) { Reset(JSonMutableObjectFactory.Create(format)); return(ReadInput() as IJSonMutableObject); }
/// <summary> /// Converts a JSON string from given input into a tree of .NET arrays, dictionaries, strings and decimals. /// </summary> public object Read(TextReader input, JSonReaderNumberFormat format) { SetSource(input); Reset(FclObjectFactory.Create(format)); return(ReadInput()); }
/// <summary> /// Converts a JSON string from given input into a tree of .NET arrays, dictionaries, strings and decimals. /// </summary> public object Read(JSonReaderNumberFormat format) { Reset(FclObjectFactory.Create(format)); return(ReadInput()); }
/// <summary> /// Converts a JSON string from given input into a tree of JSON-specific objects. /// It then allows easier deserialization for objects implementing <see cref="IJSonMutableObject"/> interface as those objects expose /// more functionality then the standard .NET ones. /// </summary> public IJSonMutableObject ReadAsJSonMutableObject(JSonReaderNumberFormat format) { // numerical formats are ignored as the BSON-spec defines them clearly: return(ReadAsJSonMutableObject()); }
/// <summary> /// Converts a JSON string from given input into a tree of .NET arrays, dictionaries, strings and decimals. /// </summary> public object Read(JSonReaderNumberFormat format) { // numerical formats are ignored as the BSON-spec defines them clearly: return(Read()); }