C# Class NuxeoClient.Marshaller

This object is responsible for the conversions between JSON objects received from the Nuxeo server and C# Nuxeo Objects.
Inheritance: IMarshaller
Show file Open project: nuxeo/nuxeo-dotnet-client

Public Methods

Method Description
Marshal ( System.Entity entity ) : Newtonsoft.Json.Linq.JObject

Marshals a nuxeo Entity to JSON.

Marshaller ( Client client ) : System

Initializes a new instance of Marshaller.

RegisterBO ( string adapterType, Type objectType ) : IMarshaller

Registers a business object type in the marshaller.

Registering a business object type in the marshaller will allow objects of this type to be marshalled and unmarshalled.

RegisterEntity ( string entityType, Type objectType ) : IMarshaller

Registers a new entity type in the marshaller.

UnMarshal ( JToken json ) : System.Entity

Unmarshals a JSON object into a nuxeo Entity.

Private Methods

Method Description
UnMarshalJArray ( Newtonsoft.Json.Linq.JArray jArr ) : System.Entity
UnMarshalJObject ( Newtonsoft.Json.Linq.JObject jObj ) : System.Entity

Method Details

Marshal() public method

Marshals a nuxeo Entity to JSON.
public Marshal ( System.Entity entity ) : Newtonsoft.Json.Linq.JObject
entity System.Entity The to be marshalled.
return Newtonsoft.Json.Linq.JObject

Marshaller() public method

Initializes a new instance of Marshaller.
public Marshaller ( Client client ) : System
client Client The client throw which objects are received and sent through.
return System

RegisterBO() public method

Registers a business object type in the marshaller.
Registering a business object type in the marshaller will allow objects of this type to be marshalled and unmarshalled.
public RegisterBO ( string adapterType, Type objectType ) : IMarshaller
adapterType string A string with the type of the adapter for the business object
objectType System.Type The type of the business object.
return IMarshaller

RegisterEntity() public method

Registers a new entity type in the marshaller.
public RegisterEntity ( string entityType, Type objectType ) : IMarshaller
entityType string The entity type.
objectType System.Type The type extending .
return IMarshaller

UnMarshal() public method

Unmarshals a JSON object into a nuxeo Entity.
public UnMarshal ( JToken json ) : System.Entity
json JToken The JSON object to be unmarshalled.
return System.Entity