DataSource.NET  7.1.27.94946-7eb8eb54
Caplin.DataSource.IJsonHandler Interface Reference

Public Member Functions

object diff (object source, object target)
 
String format (object jsonTree)
 
object parse (String jsonText)
 
object patch (object source, object jsonPatch)
 
object toJsonTree (Object pojo)
 
object toObject (object jsonTree, Object userType)
 

Detailed Description

Handler for parsing, patching and serializing Objects to JSON

JsonTreeType the type of the internal tree structure used by the underlying JSON library

Member Function Documentation

object Caplin.DataSource.IJsonHandler.diff ( object  source,
object  target 
)

Creates a JSON patch of the difference between two JSON tree representations

Parameters
sourcea JSON tree representation of the source object
targeta JSON tree representation of the target object
Returns
a JSON tree representation of the JSON patch needed to patch source to create target.
Exceptions
Exceptionif the difference operation fails
String Caplin.DataSource.IJsonHandler.format ( object  jsonTree)

Formats a JSON tree representation of an object to a JSON String.

Parameters
jsonTreea JSON tree representation of an object
Returns
the JSON String
Exceptions
Exceptionif formatting fails
object Caplin.DataSource.IJsonHandler.parse ( String  jsonText)

Parses a JSON text into a JSON tree representation used by the underlying JSON library.

Parameters
jsonTextthe JSON text to parse
Returns
a JSON tree representation of the JSON text
Exceptions
Exceptionif the parsing fails
object Caplin.DataSource.IJsonHandler.patch ( object  source,
object  jsonPatch 
)

Updates a JSON tree representation with a JSON patch

Parameters
sourcea JSON tree representation of the source object
jsonPatcha JSON tree representation of the JSON patch
Returns
the updated, patched object
Exceptions
Exceptionif the patch fails
object Caplin.DataSource.IJsonHandler.toJsonTree ( Object  pojo)

Serializes a plain Java object (POJO) to a JSON tree representation used by the underlying JSON library.

Parameters
pojoa plain Java object
Returns
a JSON tree representation of the object
Exceptions
Exceptionif conversion fails
object Caplin.DataSource.IJsonHandler.toObject ( object  jsonTree,
Object  userType 
)

Deserializes a JSON tree representation to a plain Java object

Parameters
jsonTreea JSON tree representation of the object
userTypethe type of the object to deserialize into
Returns
a new object of type userType
Exceptions
Exceptionif deserialization fails

Generated on Wed Jan 4 2023 17:00:07 for DataSource.NET