iText 8.0.2 API
iText.Commons.Utils.JsonUtil Class Reference

Utility class for JSON serialization and deserialization operations. Not for public use. More...

Static Public Member Functions

static bool  AreTwoJsonObjectEquals (String expectedString, String toCompare)
  Compares two json strings without considering the order of the elements. More...
 
static string  SerializeToString (Object value)
  Serializes passed object to JSON string. More...
 
static string  SerializeToMinimalString (Object value)
  Serializes passed object to minimal JSON string without spaces and line breaks. More...
 
static void  SerializeToStream (Stream outputStream, Object value)
 
static void  SerializeToMinimalStream (Stream outputStream, Object value)
 
static T  DeserializeFromStream< T > (Stream content)
  Deserializes passed JSON stream to object with passed type. More...
 
static T  DeserializeFromString< T > (String content)
  Deserializes passed JSON string to object with passed type. More...
 

Detailed Description

Utility class for JSON serialization and deserialization operations. Not for public use.

Member Function Documentation

◆ AreTwoJsonObjectEquals()

static bool iText.Commons.Utils.JsonUtil.AreTwoJsonObjectEquals ( String  expectedString,
String  toCompare 
)
inlinestatic

Compares two json strings without considering the order of the elements.

Parameters
expectedString expected json string
toCompare string for comparison
Returns
true if two json string are equals, false otherwise

◆ DeserializeFromStream< T >()

static T iText.Commons.Utils.JsonUtil.DeserializeFromStream< T > ( Stream  content )
inlinestatic

Deserializes passed JSON stream to object with passed type.

Parameters
content the JSON stream which represent object
objectType the type of object which will be deserialized
Template Parameters
T the type of object which will be deserialized
Returns
the deserialized object or null if operation of deserialization is impossible

◆ DeserializeFromString< T >()

static T iText.Commons.Utils.JsonUtil.DeserializeFromString< T > ( String  content )
inlinestatic

Deserializes passed JSON string to object with passed type.

Parameters
content the JSON string which represent object
objectType the type of object which will be deserialized
Template Parameters
T the type of object which will be deserialized
Returns
the deserialized object or null if operation of deserialization is impossible

◆ SerializeToMinimalString()

static string iText.Commons.Utils.JsonUtil.SerializeToMinimalString ( Object  value )
inlinestatic

Serializes passed object to minimal JSON string without spaces and line breaks.

Parameters
value the object which will be serialized
Returns
the minimal JSON string representation of passed object or null if it is impossible to serialize to JSON

◆ SerializeToString()

static string iText.Commons.Utils.JsonUtil.SerializeToString ( Object  value )
inlinestatic

Serializes passed object to JSON string.

Parameters
value the object which will be serialized
Returns
the JSON string representation of passed object or null if it is impossible to serialize to JSON