Provides methods for serializing/deserializing .NET value types to/from JSON as well as facilities for converting objects and arrays if appropriate callbacks are supplied to assist with the conversion. More...
Instance Methods | |
(instancetype) | - init |
Class Methods | |
(NSMutableArray *) | + deserializeBooleanArrayWithArrayJson: |
Deserializes a boolean array from JSON. More... | |
(FMLiveSwitchNullableBool *) | + deserializeBooleanWithValueJson: |
Deserializes a boolean value. More... | |
(NSMutableArray *) | + deserializeDecimalArrayWithArrayJson: |
Deserializes a decimal array from JSON. More... | |
(FMLiveSwitchNullableDecimal *) | + deserializeDecimalWithValueJson: |
Deserializes a decimal value. More... | |
(NSMutableDictionary< NSString *, id > *) | + deserializeDictionaryWithDictionaryJson:createDictionaryCallback:deserializeValueCallback: |
Deserializes a JSON string into a dictionary. More... | |
(NSMutableDictionary< NSString *, id > *) | + deserializeDictionaryWithDictionaryJson:createDictionaryCallbackBlock:deserializeValueCallbackBlock: |
Deserializes a JSON string into a dictionary. More... | |
(NSString *) | + deserializeDictionaryWithDictionaryJsonAndCreateDictionaryCallbackBlockAndDeserializeValueCallbackBlock |
Deserializes a JSON string into a dictionary. More... | |
(NSMutableArray *) | + deserializeDoubleArrayWithArrayJson: |
Deserializes a double array from JSON. More... | |
(FMLiveSwitchNullableDouble *) | + deserializeDoubleWithValueJson: |
Deserializes a double value. More... | |
(NSMutableArray *) | + deserializeFloatArrayWithArrayJson: |
Deserializes a float array from JSON. More... | |
(FMLiveSwitchNullableFloat *) | + deserializeFloatWithValueJson: |
Deserializes a float value. More... | |
(NSMutableArray *) | + deserializeGuidArrayWithArrayJson: |
Deserializes a GUID array from JSON. More... | |
(FMLiveSwitchNullableGuid *) | + deserializeGuidWithValueJson: |
Deserializes a globally unique identifier. More... | |
(NSMutableArray *) | + deserializeIntegerArrayWithArrayJson: |
Deserializes a integer array from JSON. More... | |
(FMLiveSwitchNullableInt *) | + deserializeIntegerWithValueJson: |
Deserializes an integer value. More... | |
(NSMutableArray *) | + deserializeLongArrayWithArrayJson: |
Deserializes a long array from JSON. More... | |
(FMLiveSwitchNullableLong *) | + deserializeLongWithValueJson: |
Deserializes a long value. More... | |
(NSMutableArray< id > *) | + deserializeObjectArrayWithJson:deserializer: |
Deserializes a JSON string into an array of target object types. More... | |
(NSMutableArray< id > *) | + deserializeObjectArrayWithJson:deserializerBlock: |
Deserializes a JSON string into an array of target object types. More... | |
(NSString *) | + deserializeObjectArrayWithJsonAndDeserializerBlock |
Deserializes a JSON string into an array of target object types. More... | |
(FMLiveSwitchSerializable *) | + deserializeObjectFastWithJson:creator:callback: |
Deserializes a JSON string into a FMLiveSwitchSerializable target object type. More... | |
(FMLiveSwitchSerializable *) | + deserializeObjectFastWithJson:creatorBlock:callbackBlock: |
Deserializes a JSON string into a FMLiveSwitchSerializable target object type. More... | |
(FMLiveSwitchSerializable *, NSString *, NSString *) | + deserializeObjectFastWithJsonAndCreatorBlockAndCallbackBlock |
Deserializes a JSON string into a FMLiveSwitchSerializable target object type. More... | |
(id) | + deserializeObjectWithJson:creator:callback: |
Deserializes a JSON string into a target object type. More... | |
(id) | + deserializeObjectWithJson:creatorBlock:callbackBlock: |
Deserializes a JSON string into a target object type. More... | |
(id, NSString *, NSString *) | + deserializeObjectWithJsonAndCreatorBlockAndCallbackBlock |
Deserializes a JSON string into a target object type. More... | |
(NSMutableArray< NSString * > *) | + deserializeRawArrayWithJson: |
Deserializes a raw array from JSON. More... | |
(NSString *) | + deserializeRawWithDataJson: |
Deserializes a piece of raw JSON. More... | |
(NSMutableArray *) | + deserializeStringArrayWithArrayJson: |
Deserializes a simple string array from JSON. More... | |
(NSString *) | + deserializeStringWithValueJson: |
Deserializes a string. More... | |
(NSString *) | + escapeStringWithText: |
Escapes any special characters in a string. More... | |
(bool) | + isValidJson: |
Determines whether the specified JSON string is valid. More... | |
(FMLiveSwitchJsonSerializer *) | + jsonSerializer |
(NSString *) | + serializeBoolean: |
Serializes a boolean value. More... | |
(NSString *) | + serializeBooleanArray: |
Serializes a boolean array to JSON. More... | |
(NSString *) | + serializeDecimal: |
Serializes a decimal value. More... | |
(NSString *) | + serializeDecimalArray: |
Serializes a decimal array to JSON. More... | |
(NSString *) | + serializeDictionary:serializeValueCallback: |
Serializes a dictionary into a JSON string. More... | |
(NSString *) | + serializeDictionary:serializeValueCallbackBlock: |
Serializes a dictionary into a JSON string. More... | |
(id) | + serializeDictionaryAndSerializeValueCallbackBlock |
Serializes a dictionary into a JSON string. More... | |
(NSString *) | + serializeDouble: |
Serializes a double value. More... | |
(NSString *) | + serializeDoubleArray: |
Serializes a double array to JSON. More... | |
(NSString *) | + serializeFloat: |
Serializes a float value. More... | |
(NSString *) | + serializeFloatArray: |
Serializes a float array to JSON. More... | |
(NSString *) | + serializeGuid: |
Serializes a globally unique identifier. More... | |
(NSString *) | + serializeGuidArray: |
Serializes a GUID array to JSON. More... | |
(NSString *) | + serializeInteger: |
Serializes an integer value. More... | |
(NSString *) | + serializeIntegerArray: |
Serializes a integer array to JSON. More... | |
(NSString *) | + serializeLong: |
Serializes a long value. More... | |
(NSString *) | + serializeLongArray: |
Serializes a long array to JSON. More... | |
(NSString *) | + serializeObjectArrayWithObjects:serializer: |
Serializes an object array into a JSON string. More... | |
(NSString *) | + serializeObjectArrayWithObjects:serializerBlock: |
Serializes an object array into a JSON string. More... | |
(id) | + serializeObjectArrayWithObjectsAndSerializerBlock |
Serializes an object array into a JSON string. More... | |
(NSString *) | + serializeObjectFastWithSource:callback: |
Serializes a FMLiveSwitchSerializable object into a JSON string. More... | |
(NSString *) | + serializeObjectFastWithSource:callbackBlock: |
Serializes a FMLiveSwitchSerializable object into a JSON string. More... | |
(FMLiveSwitchSerializable *, NSMutableDictionary< NSString *, NSString * > *) | + serializeObjectFastWithSourceAndCallbackBlock |
Serializes a FMLiveSwitchSerializable object into a JSON string. More... | |
(NSString *) | + serializeObjectWithSource:callback: |
Serializes an object into a JSON string. More... | |
(NSString *) | + serializeObjectWithSource:callbackBlock: |
Serializes an object into a JSON string. More... | |
(id, NSMutableDictionary< NSString *, NSString * > *) | + serializeObjectWithSourceAndCallbackBlock |
Serializes an object into a JSON string. More... | |
(NSString *) | + serializeRawArrayWithJsons: |
Serializes a raw array to JSON. More... | |
(NSString *) | + serializeRawWithDataJson: |
Serializes a piece of raw JSON. More... | |
(NSString *) | + serializeString: |
Serializes a string. More... | |
(NSString *) | + serializeStringArray: |
Serializes a string array to JSON. More... | |
(NSString *) | + trimQuotes: |
Trims the quotes from a JavaScript string value. More... | |
(NSString *) | + unescapeStringWithText: |
Unescapes any special characters from a string. More... | |
Provides methods for serializing/deserializing .NET value types to/from JSON as well as facilities for converting objects and arrays if appropriate callbacks are supplied to assist with the conversion.
+ (NSMutableArray*) deserializeBooleanArrayWithArrayJson: | (NSString *) | arrayJson |
Deserializes a boolean array from JSON.
arrayJson | A JSON-serialized boolean array. |
+ (FMLiveSwitchNullableBool*) deserializeBooleanWithValueJson: | (NSString *) | valueJson |
Deserializes a boolean value.
valueJson | The boolean JSON to deserialize. |
+ (NSMutableArray*) deserializeDecimalArrayWithArrayJson: | (NSString *) | arrayJson |
Deserializes a decimal array from JSON.
arrayJson | A JSON-serialized decimal array. |
+ (FMLiveSwitchNullableDecimal*) deserializeDecimalWithValueJson: | (NSString *) | valueJson |
Deserializes a decimal value.
valueJson | The decimal JSON to deserialize. |
+ (NSMutableDictionary<NSString*,id>*) deserializeDictionaryWithDictionaryJson: | (NSString *) | dictionaryJson | |
createDictionaryCallback: | (FMLiveSwitchFunction0< NSMutableDictionary< NSString *, id > * > *) | createDictionaryCallback | |
deserializeValueCallback: | (FMLiveSwitchFunction1< NSString *, id > *) | deserializeValueCallback | |
Deserializes a JSON string into a dictionary.
dictionaryJson | The JSON-encoded dictionary. |
createDictionaryCallback | The callback that creates a blank dictionary. |
deserializeValueCallback | The callback that deserializes a value. |
+ (NSMutableDictionary<NSString*,id>*) deserializeDictionaryWithDictionaryJson: | (NSString *) | dictionaryJson | |
createDictionaryCallbackBlock: | (NSMutableDictionary< NSString *, id > *(^)(void)) | createDictionaryCallbackBlock | |
deserializeValueCallbackBlock: | (id(^)(NSString *)) | deserializeValueCallbackBlock | |
Deserializes a JSON string into a dictionary.
dictionaryJson | The JSON-encoded dictionary. |
createDictionaryCallbackBlock | The callback that creates a blank dictionary. |
deserializeValueCallbackBlock | The callback that deserializes a value. |
+ (NSString*) deserializeDictionaryWithDictionaryJsonAndCreateDictionaryCallbackBlockAndDeserializeValueCallbackBlock |
Deserializes a JSON string into a dictionary.
@inlineparam dictionaryJson The JSON-encoded dictionary. @inlineparam createDictionaryCallbackBlock The callback that creates a blank dictionary. @inlineparam deserializeValueCallbackBlock The callback that deserializes a value.
+ (NSMutableArray*) deserializeDoubleArrayWithArrayJson: | (NSString *) | arrayJson |
Deserializes a double array from JSON.
arrayJson | A JSON-serialized double array. |
+ (FMLiveSwitchNullableDouble*) deserializeDoubleWithValueJson: | (NSString *) | valueJson |
Deserializes a double value.
valueJson | The double JSON to deserialize. |
+ (NSMutableArray*) deserializeFloatArrayWithArrayJson: | (NSString *) | arrayJson |
Deserializes a float array from JSON.
arrayJson | A JSON-serialized float array. |
+ (FMLiveSwitchNullableFloat*) deserializeFloatWithValueJson: | (NSString *) | valueJson |
Deserializes a float value.
valueJson | The float JSON to deserialize. |
+ (NSMutableArray*) deserializeGuidArrayWithArrayJson: | (NSString *) | arrayJson |
Deserializes a GUID array from JSON.
arrayJson | A JSON-serialized GUID array. |
+ (FMLiveSwitchNullableGuid*) deserializeGuidWithValueJson: | (NSString *) | valueJson |
Deserializes a globally unique identifier.
valueJson | The GUID JSON to deserialize. |
+ (NSMutableArray*) deserializeIntegerArrayWithArrayJson: | (NSString *) | arrayJson |
Deserializes a integer array from JSON.
arrayJson | A JSON-serialized integer array. |
+ (FMLiveSwitchNullableInt*) deserializeIntegerWithValueJson: | (NSString *) | valueJson |
Deserializes an integer value.
valueJson | The integer JSON to deserialize. |
+ (NSMutableArray*) deserializeLongArrayWithArrayJson: | (NSString *) | arrayJson |
Deserializes a long array from JSON.
arrayJson | A JSON-serialized long array. |
+ (FMLiveSwitchNullableLong*) deserializeLongWithValueJson: | (NSString *) | valueJson |
Deserializes a long value.
valueJson | The long JSON to deserialize. |
+ (NSMutableArray<id>*) deserializeObjectArrayWithJson: | (NSString *) | json | |
deserializer: | (FMLiveSwitchFunction1< NSString *, id > *) | deserializer | |
Deserializes a JSON string into an array of target object types.
json | The JSON-encoded string. |
deserializer | The callback used to deserialize each item in the array. |
+ (NSMutableArray<id>*) deserializeObjectArrayWithJson: | (NSString *) | json | |
deserializerBlock: | (id(^)(NSString *)) | deserializerBlock | |
Deserializes a JSON string into an array of target object types.
json | The JSON-encoded string. |
deserializerBlock | The callback used to deserialize each item in the array. |
+ (NSString*) deserializeObjectArrayWithJsonAndDeserializerBlock |
Deserializes a JSON string into an array of target object types.
@inlineparam json The JSON-encoded string. @inlineparam deserializerBlock The callback used to deserialize each item in the array.
+ (FMLiveSwitchSerializable*) deserializeObjectFastWithJson: | (NSString *) | json | |
creator: | (FMLiveSwitchFunction0< FMLiveSwitchSerializable * > *) | creator | |
callback: | (FMLiveSwitchAction3< FMLiveSwitchSerializable *, NSString *, NSString * > *) | callback | |
Deserializes a JSON string into a FMLiveSwitchSerializable target object type.
json | The JSON-encoded string. |
creator | The method used for creating a new object. |
callback | The method used for deserializing a property. |
+ (FMLiveSwitchSerializable*) deserializeObjectFastWithJson: | (NSString *) | json | |
creatorBlock: | (FMLiveSwitchSerializable *(^)(void)) | creatorBlock | |
callbackBlock: | (void(^)(FMLiveSwitchSerializable *, NSString *, NSString *)) | callbackBlock | |
Deserializes a JSON string into a FMLiveSwitchSerializable target object type.
json | The JSON-encoded string. |
creatorBlock | The method used for creating a new object. |
callbackBlock | The method used for deserializing a property. |
+ (FMLiveSwitchSerializable*, NSString*, NSString*) deserializeObjectFastWithJsonAndCreatorBlockAndCallbackBlock |
Deserializes a JSON string into a FMLiveSwitchSerializable target object type.
@inlineparam json The JSON-encoded string. @inlineparam creatorBlock The method used for creating a new object. @inlineparam callbackBlock The method used for deserializing a property.
+ (id) deserializeObjectWithJson: | (NSString *) | json | |
creator: | (FMLiveSwitchFunction0< id > *) | creator | |
callback: | (FMLiveSwitchAction3< id, NSString *, NSString * > *) | callback | |
Deserializes a JSON string into a target object type.
json | The JSON-encoded string. |
creator | The method used for creating a new object. |
callback | The method used for deserializing a property. |
+ (id) deserializeObjectWithJson: | (NSString *) | json | |
creatorBlock: | (id(^)(void)) | creatorBlock | |
callbackBlock: | (void(^)(id, NSString *, NSString *)) | callbackBlock | |
Deserializes a JSON string into a target object type.
json | The JSON-encoded string. |
creatorBlock | The method used for creating a new object. |
callbackBlock | The method used for deserializing a property. |
Deserializes a JSON string into a target object type.
@inlineparam json The JSON-encoded string. @inlineparam creatorBlock The method used for creating a new object. @inlineparam callbackBlock The method used for deserializing a property.
Deserializes a raw array from JSON.
json | A JSON-serialized raw array. |
Deserializes a piece of raw JSON.
dataJson | The raw data. |
+ (NSMutableArray*) deserializeStringArrayWithArrayJson: | (NSString *) | arrayJson |
Deserializes a simple string array from JSON.
arrayJson | A JSON-serialized string array. |
Deserializes a string.
valueJson | The string to deserialize. |
Escapes any special characters in a string.
text | The string without escaped characters. |
- (instancetype) init |
Implemented in FMLiveSwitchSerializer.
+ (bool) isValidJson: | (NSString *) | json |
Determines whether the specified JSON string is valid.
json | The JSON string to validate. |
+ (FMLiveSwitchJsonSerializer*) jsonSerializer |
+ (NSString*) serializeBoolean: | (FMLiveSwitchNullableBool *) | value |
Serializes a boolean value.
value | The boolean to serialize. |
+ (NSString*) serializeBooleanArray: | (NSMutableArray *) | array |
Serializes a boolean array to JSON.
array | An array of boolean values. |
+ (NSString*) serializeDecimal: | (FMLiveSwitchNullableDecimal *) | value |
Serializes a decimal value.
value | The decimal to serialize. |
+ (NSString*) serializeDecimalArray: | (NSMutableArray *) | array |
Serializes a decimal array to JSON.
array | An array of decimal values. |
+ (NSString*) serializeDictionary: | (NSMutableDictionary< NSString *, id > *) | dictionary | |
serializeValueCallback: | (FMLiveSwitchFunction1< id, NSString * > *) | serializeValueCallback | |
Serializes a dictionary into a JSON string.
dictionary | The dictionary being serialized. |
serializeValueCallback | The callback that serializes a value. |
+ (NSString*) serializeDictionary: | (NSMutableDictionary< NSString *, id > *) | dictionary | |
serializeValueCallbackBlock: | (NSString *(^)(id)) | serializeValueCallbackBlock | |
Serializes a dictionary into a JSON string.
dictionary | The dictionary being serialized. |
serializeValueCallbackBlock | The callback that serializes a value. |
+ (id) serializeDictionaryAndSerializeValueCallbackBlock |
Serializes a dictionary into a JSON string.
@inlineparam dictionary The dictionary being serialized. @inlineparam serializeValueCallbackBlock The callback that serializes a value.
+ (NSString*) serializeDouble: | (FMLiveSwitchNullableDouble *) | value |
Serializes a double value.
value | The double to serialize. |
+ (NSString*) serializeDoubleArray: | (NSMutableArray *) | array |
Serializes a double array to JSON.
array | An array of double values. |
+ (NSString*) serializeFloat: | (FMLiveSwitchNullableFloat *) | value |
Serializes a float value.
value | The float to serialize. |
+ (NSString*) serializeFloatArray: | (NSMutableArray *) | array |
Serializes a float array to JSON.
array | An array of float values. |
+ (NSString*) serializeGuid: | (FMLiveSwitchNullableGuid *) | value |
Serializes a globally unique identifier.
value | The GUID to serialize. |
+ (NSString*) serializeGuidArray: | (NSMutableArray *) | array |
Serializes a GUID array to JSON.
array | An array of GUID values. |
+ (NSString*) serializeInteger: | (FMLiveSwitchNullableInt *) | value |
Serializes an integer value.
value | The integer to serialize. |
+ (NSString*) serializeIntegerArray: | (NSMutableArray *) | array |
Serializes a integer array to JSON.
array | An array of integer values. |
+ (NSString*) serializeLong: | (FMLiveSwitchNullableLong *) | value |
Serializes a long value.
value | The long to serialize. |
+ (NSString*) serializeLongArray: | (NSMutableArray *) | array |
Serializes a long array to JSON.
array | An array of long values. |
+ (NSString*) serializeObjectArrayWithObjects: | (NSMutableArray *) | objects | |
serializer: | (FMLiveSwitchFunction1< id, NSString * > *) | serializer | |
Serializes an object array into a JSON string.
objects | The object array being serialized. |
serializer | The callback used to serialize each item in the array. |
+ (NSString*) serializeObjectArrayWithObjects: | (NSMutableArray *) | objects | |
serializerBlock: | (NSString *(^)(id)) | serializerBlock | |
Serializes an object array into a JSON string.
objects | The object array being serialized. |
serializerBlock | The callback used to serialize each item in the array. |
+ (id) serializeObjectArrayWithObjectsAndSerializerBlock |
Serializes an object array into a JSON string.
@inlineparam objects The object array being serialized. @inlineparam serializerBlock The callback used to serialize each item in the array.
+ (NSString*) serializeObjectFastWithSource: | (FMLiveSwitchSerializable *) | source | |
callback: | (FMLiveSwitchAction2< FMLiveSwitchSerializable *, NSMutableDictionary< NSString *, NSString * > * > *) | callback | |
Serializes a FMLiveSwitchSerializable object into a JSON string.
source | The object being serialized. |
callback | The method used for serializing properties. |
+ (NSString*) serializeObjectFastWithSource: | (FMLiveSwitchSerializable *) | source | |
callbackBlock: | (void(^)(FMLiveSwitchSerializable *, NSMutableDictionary< NSString *, NSString * > *)) | callbackBlock | |
Serializes a FMLiveSwitchSerializable object into a JSON string.
source | The object being serialized. |
callbackBlock | The method used for serializing properties. |
+ (FMLiveSwitchSerializable*, NSMutableDictionary<NSString*,NSString*>*) serializeObjectFastWithSourceAndCallbackBlock |
Serializes a FMLiveSwitchSerializable object into a JSON string.
@inlineparam source The object being serialized. @inlineparam callbackBlock The method used for serializing properties.
+ (NSString*) serializeObjectWithSource: | (id) | source | |
callback: | (FMLiveSwitchAction2< id, NSMutableDictionary< NSString *, NSString * > * > *) | callback | |
Serializes an object into a JSON string.
source | The object being serialized. |
callback | The method used for serializing properties. |
+ (NSString*) serializeObjectWithSource: | (id) | source | |
callbackBlock: | (void(^)(id, NSMutableDictionary< NSString *, NSString * > *)) | callbackBlock | |
Serializes an object into a JSON string.
source | The object being serialized. |
callbackBlock | The method used for serializing properties. |
Serializes an object into a JSON string.
@inlineparam source The object being serialized. @inlineparam callbackBlock The method used for serializing properties.
+ (NSString*) serializeRawArrayWithJsons: | (NSMutableArray *) | jsons |
Serializes a raw array to JSON.
jsons | An array of raw values. |
Serializes a piece of raw JSON.
dataJson | The raw data. |
Serializes a string.
value | The string to serialize. |
+ (NSString*) serializeStringArray: | (NSMutableArray *) | array |
Serializes a string array to JSON.
array | An array of string values. |
Trims the quotes from a JavaScript string value.
value | The JavaScript string value. |