Class: DataMapping

DataMapping

new DataMapping()

Maps raw data to data objects of a specific type. Currently services define their mapping by overriding their mapRawDataToObject() and mapObjectToRawData() methods or by using a DataMapping subclass that overrides its mapRawDataToObject() and mapRawDataToObject() methods. In the future it will be possible to define mappings declaratively through mapping descriptors read from blueprint files.
Source:

Extends

  • external:Montage

Members

mapFromRawData

Source:
To Do:

mapObjectToRawData

Source:
To Do:
  • Document.

mapToRawData

Source:
To Do:

Methods

mapRawDataToObject(object, data, context)

Convert raw data to data objects of an appropriate type. Subclasses should override this method to map properties of the raw data to data objects, as in the following: mapRawDataToObject: { value: function (object, data) { object.firstName = data.GIVEN_NAME; object.lastName = data.FAMILY_NAME; } } The default implementation of this method copies the properties defined by the raw data object to the data object.
Parameters:
Name Type Description
object Object An object whose properties must be set or modified to represent the raw data.
data Object An object whose properties' values hold the raw data.
context ? A value that was passed in to the addRawData() call that invoked this method.
Source: