Inherits from NSObject
Declared in EBPropertyMapper.h
EBPropertyMapper.m

Overview

The EBPropertyMapper class is used to associate the property names of a NSObject to the JSON property names.

For example, for a class defined as

Person(name, age)

And a JSON defined as

{ "jname" : "peter", "jage" : 35 }

A mapper can be defined as:

propertyMapper = @[@"name" : @"jname", @"age" : @"jage"];

Tasks

Properties

propertyMapper

Dictionary containing an equivalence between JSON and Class property names.

@property (nonatomic, retain) NSDictionary *propertyMapper

Discussion

Dictionary containing an equivalence between JSON and Class property names.

Declared In

EBPropertyMapper.h

theClass

The class which this mapper is associated to.

@property (nonatomic, retain) Class theClass

Discussion

The class which this mapper is associated to.

Note “class” is a reserved word.

Declared In

EBPropertyMapper.h

Class Methods

mapperWithClass:properties:

+ (id)mapperWithClass:(Class)aClass properties:(NSDictionary *)properties

Parameters

aClass

The class to be mapped.

properties

The class properties that must be mapped to another name.

Discussion

See initWithClass:properties:

Declared In

EBPropertyMapper.h

Instance Methods

initWithClass:properties:

Returns a Property Mapper with the specified class and properties.

- (id)initWithClass:(Class)aClass properties:(NSDictionary *)properties

Parameters

aClass

The class to be mapped.

properties

The class properties that must be mapped to another name.

Discussion

Returns a Property Mapper with the specified class and properties.

Declared In

EBPropertyMapper.h