# Class: MappingRule

## MappingRule

#### new MappingRule()

Instructions to map raw data to model objects or model objects to model objects

Source:
  - data/service/mapping-rule.js, line 9

### Extends

- external:Montage

### Members

#### converter :Converter

A converter that takes in the the output of #expression and returns the destination value.

##### Type:

- Converter

Source:
  - data/service/mapping-rule.js, line 16

#### expression :string

The expression that defines the input to be passed to .converter. If converter is not provided, the output of the expression is assigned directly to the destination value.

##### Type:

- string

Source:
  - data/service/mapping-rule.js, line 25

#### inversePropertyName :string

The name of the property on the destination value that the destination object represents. For example, consider: The MappingRule for Foo.bars will have inversePropertyName = foo.

##### Type:

- string

Source:
  - data/service/mapping-rule.js, line 37

#### isReverter :boolean

Flag defining the direction of the conversion. If true, .expression will be evaluated in reverse (evaluate the expression against the destination & assign it to the source).

##### Type:

- boolean

Source:
  - data/service/mapping-rule.js, line 48

#### propertyDescriptor :PropertyDescriptor

The descriptor for the property that this rule applies to

##### Type:

- PropertyDescriptor

Source:
  - data/service/mapping-rule.js, line 57

#### requirements :Array.<string>

The names of the properties required to evaluate .expression The raw data that .expression is evaluated against may not have all of the properties referenced in .expression before the the MappingRule is used. This array is used at the time of mapping to populate the raw data with any properties that are missing.

##### Type:

- Array.<string>

Source:
  - data/service/mapping-rule.js, line 71

#### serviceIdentifier :string

Identifier for the child service of ExpressionDataMapping.service that the destination value should be fetched from.

##### Type:

- string

Source:
  - data/service/mapping-rule.js, line 80

#### targetPath :string

Path of the property to which the value of the expression should be assigned.

##### Type:

- string

Source:
  - data/service/mapping-rule.js, line 88