Inherits from NSObject
Conforms to NSCopying
Declared in RKPropertyMapping.h

Overview

RKPropertyMapping is an abstract class for describing the properties being mapped within an RKObjectMapping or RKEntityMapping object. It defines the common interface for its concrete subclasses RKAttributeMapping and RKRelationshipMapping. Each property mapping defines a single transformation from a source key path (often in the deserialized representation of a JSON or XML document) to a destination key path (typically on a target object).

Tasks

Accessing the Parent Object Mapping

Accessing the Source and Destination Key Paths

  •   sourceKeyPath

    A key path on the source object from which to get information that is to be mapped onto the destination object.

    property
  •   destinationKeyPath

    A key path on the destination object on which to set information that has been mapped from the source object.

    property

Specifying a Value Transformer

  •   propertyValueClass

    Specifies the class used to represent the value of the mapped property. A value of Nil (which is the default value) indicates the property class is to be determined by runtime introspection.

    property
  •   valueTransformer

    A value transformer with which to process input values being mapped with the receiver. If nil, then the valueTransformer of the parent objectMapping will be used instead.

    property

Comparing Property Mappings

Properties

destinationKeyPath

@property (nonatomic, copy, readonly) NSString *destinationKeyPath
Discussion

A key path on the destination object on which to set information that has been mapped from the source object.

Declared In

RKPropertyMapping.h

objectMapping

@property (nonatomic, weak, readonly) RKObjectMapping *objectMapping
Discussion

Returns the object mapping the receiver is added to.

Declared In

RKPropertyMapping.h

propertyValueClass

@property (nonatomic, strong) Class propertyValueClass
Discussion

Specifies the class used to represent the value of the mapped property. A value of Nil (which is the default value) indicates the property class is to be determined by runtime introspection.

In cases where run-time type introspection cannot be performed (such as during object parameterization) you can specify the class used to represent the value of the property being mapped.

Declared In

RKPropertyMapping.h

sourceKeyPath

@property (nonatomic, copy, readonly) NSString *sourceKeyPath
Discussion

A key path on the source object from which to get information that is to be mapped onto the destination object.

Declared In

RKPropertyMapping.h

valueTransformer

@property (nonatomic, strong) id<RKValueTransforming> valueTransformer
Discussion

A value transformer with which to process input values being mapped with the receiver. If nil, then the valueTransformer of the parent objectMapping will be used instead.

Declared In

RKPropertyMapping.h

Instance Methods

isEqualToMapping:

- (BOOL)isEqualToMapping:(RKPropertyMapping *)otherMapping
Discussion

Compares the receiving property mapping to another property mapping.

Two property mappings are equal if they are of the same type (i.e. an RKAttributeMapping or an RKRelatiobshipMapping object) and specify a mapping from the same source key path to the same destination key path.

Parameters

otherMapping

The property mapping object with which to compare the receiver.

Return Value

YES if otherMapping specifies the same mapping as the receiver, otherwise NO.

Declared In

RKPropertyMapping.h