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...
Public Member Functions | |
JsonSerializer () | |
Static Public Member Functions | |
static fm.liveswitch.NullableBoolean | deserializeBoolean (String valueJson) |
Deserializes a boolean value. More... | |
static boolean[] | deserializeBooleanArray (String arrayJson) |
Deserializes a boolean array from JSON. More... | |
static fm.liveswitch.NullableBigDecimal | deserializeDecimal (String valueJson) |
Deserializes a decimal value. More... | |
static java.math.BigDecimal[] | deserializeDecimalArray (String arrayJson) |
Deserializes a decimal array from JSON. More... | |
static< T > java.util.HashMap< String, T > | deserializeDictionary (String dictionaryJson, fm.liveswitch.IFunction0< java.util.HashMap< String, T >> createDictionaryCallback, final fm.liveswitch.IFunction1< String, T > deserializeValueCallback) |
Deserializes a JSON string into a dictionary. More... | |
static fm.liveswitch.NullableDouble | deserializeDouble (String valueJson) |
Deserializes a double value. More... | |
static double[] | deserializeDoubleArray (String arrayJson) |
Deserializes a double array from JSON. More... | |
static fm.liveswitch.NullableFloat | deserializeFloat (String valueJson) |
Deserializes a float value. More... | |
static float[] | deserializeFloatArray (String arrayJson) |
Deserializes a float array from JSON. More... | |
static fm.liveswitch.NullableGuid | deserializeGuid (String valueJson) |
Deserializes a globally unique identifier. More... | |
static fm.liveswitch.Guid[] | deserializeGuidArray (String arrayJson) |
Deserializes a GUID array from JSON. More... | |
static fm.liveswitch.NullableInteger | deserializeInteger (String valueJson) |
Deserializes an integer value. More... | |
static int[] | deserializeIntegerArray (String arrayJson) |
Deserializes a integer array from JSON. More... | |
static fm.liveswitch.NullableLong | deserializeLong (String valueJson) |
Deserializes a long value. More... | |
static long[] | deserializeLongArray (String arrayJson) |
Deserializes a long array from JSON. More... | |
static< T > T | deserializeObject (String json, fm.liveswitch.IFunction0< T > creator, fm.liveswitch.IAction3< T, String, String > callback) |
Deserializes a JSON string into a target object type. More... | |
static< T > java.util.ArrayList< T > | deserializeObjectArray (String json, fm.liveswitch.IFunction1< String, T > deserializer) |
Deserializes a JSON string into an array of target object types. More... | |
static< T extends fm.liveswitch.Serializable > T | deserializeObjectFast (String json, fm.liveswitch.IFunction0< T > creator, fm.liveswitch.IAction3< T, String, String > callback) |
Deserializes a JSON string into a fm.liveswitch.Serializable target object type. More... | |
static String | deserializeRaw (String dataJson) |
Deserializes a piece of raw JSON. More... | |
static java.util.ArrayList< String > | deserializeRawArray (String json) |
Deserializes a raw array from JSON. More... | |
static String | deserializeString (String valueJson) |
Deserializes a string. More... | |
static String[] | deserializeStringArray (String arrayJson) |
Deserializes a simple string array from JSON. More... | |
static String | escapeString (String text) |
Escapes any special characters in a string. More... | |
static boolean | isValidJson (String json) |
Determines whether the specified JSON string is valid. More... | |
static String | serializeBoolean (fm.liveswitch.NullableBoolean value) |
Serializes a boolean value. More... | |
static String | serializeBooleanArray (boolean[] array) |
Serializes a boolean array to JSON. More... | |
static String | serializeDecimal (fm.liveswitch.NullableBigDecimal value) |
Serializes a decimal value. More... | |
static String | serializeDecimalArray (java.math.BigDecimal[] array) |
Serializes a decimal array to JSON. More... | |
static< T > String | serializeDictionary (java.util.HashMap< String, T > dictionary, final fm.liveswitch.IFunction1< T, String > serializeValueCallback) |
Serializes a dictionary into a JSON string. More... | |
static String | serializeDouble (fm.liveswitch.NullableDouble value) |
Serializes a double value. More... | |
static String | serializeDoubleArray (double[] array) |
Serializes a double array to JSON. More... | |
static String | serializeFloat (fm.liveswitch.NullableFloat value) |
Serializes a float value. More... | |
static String | serializeFloatArray (float[] array) |
Serializes a float array to JSON. More... | |
static String | serializeGuid (fm.liveswitch.NullableGuid value) |
Serializes a globally unique identifier. More... | |
static String | serializeGuidArray (fm.liveswitch.Guid[] array) |
Serializes a GUID array to JSON. More... | |
static String | serializeInteger (fm.liveswitch.NullableInteger value) |
Serializes an integer value. More... | |
static String | serializeIntegerArray (int[] array) |
Serializes a integer array to JSON. More... | |
static String | serializeLong (fm.liveswitch.NullableLong value) |
Serializes a long value. More... | |
static String | serializeLongArray (long[] array) |
Serializes a long array to JSON. More... | |
static< T > String | serializeObject (T source, fm.liveswitch.IAction2< T, java.util.HashMap< String, String >> callback) |
Serializes an object into a JSON string. More... | |
static< T > String | serializeObjectArray (T[] objects, fm.liveswitch.IFunction1< T, String > serializer) |
Serializes an object array into a JSON string. More... | |
static< T extends fm.liveswitch.Serializable > String | serializeObjectFast (T source, fm.liveswitch.IAction2< T, java.util.HashMap< String, String >> callback) |
Serializes a fm.liveswitch.Serializable object into a JSON string. More... | |
static String | serializeRaw (String dataJson) |
Serializes a piece of raw JSON. More... | |
static String | serializeRawArray (String[] jsons) |
Serializes a raw array to JSON. More... | |
static String | serializeString (String value) |
Serializes a string. More... | |
static String | serializeStringArray (String[] array) |
Serializes a string array to JSON. More... | |
static String | trimQuotes (String value) |
Trims the quotes from a JavaScript string value. More... | |
static String | unescapeString (String text) |
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.
fm.liveswitch.JsonSerializer.JsonSerializer | ( | ) |
|
static |
Deserializes a boolean value.
valueJson | The boolean JSON to deserialize. |
|
static |
Deserializes a boolean array from JSON.
arrayJson | A JSON-serialized boolean array. |
|
static |
Deserializes a decimal value.
valueJson | The decimal JSON to deserialize. |
|
static |
Deserializes a decimal array from JSON.
arrayJson | A JSON-serialized decimal array. |
|
static |
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. |
|
static |
Deserializes a double value.
valueJson | The double JSON to deserialize. |
|
static |
Deserializes a double array from JSON.
arrayJson | A JSON-serialized double array. |
|
static |
Deserializes a float value.
valueJson | The float JSON to deserialize. |
|
static |
Deserializes a float array from JSON.
arrayJson | A JSON-serialized float array. |
|
static |
Deserializes a globally unique identifier.
valueJson | The GUID JSON to deserialize. |
|
static |
Deserializes a GUID array from JSON.
arrayJson | A JSON-serialized GUID array. |
|
static |
Deserializes an integer value.
valueJson | The integer JSON to deserialize. |
|
static |
Deserializes a integer array from JSON.
arrayJson | A JSON-serialized integer array. |
|
static |
Deserializes a long value.
valueJson | The long JSON to deserialize. |
|
static |
Deserializes a long array from JSON.
arrayJson | A JSON-serialized long array. |
|
static |
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. |
|
static |
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. |
|
static |
Deserializes a JSON string into a fm.liveswitch.Serializable 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. |
|
static |
Deserializes a piece of raw JSON.
dataJson | The raw data. |
|
static |
Deserializes a raw array from JSON.
json | A JSON-serialized raw array. |
|
static |
Deserializes a string.
valueJson | The string to deserialize. |
|
static |
Deserializes a simple string array from JSON.
arrayJson | A JSON-serialized string array. |
|
static |
Escapes any special characters in a string.
text | The string without escaped characters. |
|
static |
Determines whether the specified JSON string is valid.
json | The JSON string to validate. |
|
static |
Serializes a boolean value.
value | The boolean to serialize. |
|
static |
Serializes a boolean array to JSON.
array | An array of boolean values. |
|
static |
Serializes a decimal value.
value | The decimal to serialize. |
|
static |
Serializes a decimal array to JSON.
array | An array of decimal values. |
|
static |
Serializes a dictionary into a JSON string.
dictionary | The dictionary being serialized. |
serializeValueCallback | The callback that serializes a value. |
|
static |
Serializes a double value.
value | The double to serialize. |
|
static |
Serializes a double array to JSON.
array | An array of double values. |
|
static |
Serializes a float value.
value | The float to serialize. |
|
static |
Serializes a float array to JSON.
array | An array of float values. |
|
static |
Serializes a globally unique identifier.
value | The GUID to serialize. |
|
static |
Serializes a GUID array to JSON.
array | An array of GUID values. |
|
static |
Serializes an integer value.
value | The integer to serialize. |
|
static |
Serializes a integer array to JSON.
array | An array of integer values. |
|
static |
Serializes a long value.
value | The long to serialize. |
|
static |
Serializes a long array to JSON.
array | An array of long values. |
|
static |
Serializes an object into a JSON string.
source | The object being serialized. |
callback | The method used for serializing properties. |
|
static |
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. |
|
static |
Serializes a fm.liveswitch.Serializable object into a JSON string.
source | The object being serialized. |
callback | The method used for serializing properties. |
|
static |
Serializes a piece of raw JSON.
dataJson | The raw data. |
|
static |
Serializes a raw array to JSON.
jsons | An array of raw values. |
|
static |
Serializes a string.
value | The string to serialize. |
|
static |
Serializes a string array to JSON.
array | An array of string values. |
|
static |
Trims the quotes from a JavaScript string value.
value | The JavaScript string value. |
|
static |
Unescapes any special characters from a string.
text | The string with escaped characters. |