DataSource.NET  7.1.31.142147-b54558a5
Caplin.DataSource.IJsonHandler Interface Reference
Inheritance diagram for Caplin.DataSource.IJsonHandler:
Caplin.DataSource.Messaging.JSON.NativeJsonHandler

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)
 
ToObject< T > (object jsonTree, T 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

Implemented in Caplin.DataSource.Messaging.JSON.NativeJsonHandler.

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

Implemented in Caplin.DataSource.Messaging.JSON.NativeJsonHandler.

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

Implemented in Caplin.DataSource.Messaging.JSON.NativeJsonHandler.

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
T Caplin.DataSource.IJsonHandler.ToObject< T > ( object  jsonTree,
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

Implemented in Caplin.DataSource.Messaging.JSON.NativeJsonHandler.


Generated on Fri Jul 7 2023 17:09:44 for DataSource.NET