Inherits from NSObject
Declared in EBJSONObjectMapper.h
EBJSONObjectMapper.m

Overview

Maps a NSDictionary from a JSON to a NSObject.

Tasks

Other Methods

Other Methods

Properties

classes

Mapper’s classes for this object

@property (nonatomic, readonly) NSArray *classes

Discussion

Mapper’s classes for this object

Declared In

EBJSONObjectMapper.h

propertyMappers

Optional. A list of EBPropertyMapper between NSObject property names and JSON fields. See EBPropertyMapper.

@property (nonatomic, retain) NSArray *propertyMappers

Discussion

Optional. A list of EBPropertyMapper between NSObject property names and JSON fields. See EBPropertyMapper.

Declared In

EBJSONObjectMapper.h

Class Methods

mapperWithClass:

Creates an autoreleased mapper for the specified class. See initWithClass:

+ (id)mapperWithClass:(Class)class

Parameters

class

The class to be mapped to

Discussion

Creates an autoreleased mapper for the specified class. See initWithClass:

Declared In

EBJSONObjectMapper.h

mapperWithClasses:

Creates an autoreleased mapper for the specified classes. See initWithClasses:

+ (id)mapperWithClasses:(NSArray *)classes

Parameters

classes

The possible classes to map to.

Discussion

Creates an autoreleased mapper for the specified classes. See initWithClasses:

Declared In

EBJSONObjectMapper.h

mapperWithClasses:propertyMappers:

Creates an autoreleased mapper for the specified classes and property mappers. See initWithClasses:propertyMappers:

+ (id)mapperWithClasses:(NSArray *)classes propertyMappers:(NSArray *)propertyMappers

Discussion

Creates an autoreleased mapper for the specified classes and property mappers. See initWithClasses:propertyMappers:

Declared In

EBJSONObjectMapper.h

Instance Methods

initWithClass:

Creates a mapper instance for the specified class.

- (id)initWithClass:(Class)class

Parameters

class

The class to be mapped to

Discussion

Creates a mapper instance for the specified class.

Declared In

EBJSONObjectMapper.h

initWithClasses:

Creates a mapper instance with several possible clases.

- (id)initWithClasses:(NSArray *)classes

Parameters

classes

The possible classes to map to

Discussion

Creates a mapper instance with several possible clases.

Declared In

EBJSONObjectMapper.h

initWithClasses:propertyMappers:

Creates a mapper instance with several possible classes and property mappers.

- (id)initWithClasses:(NSArray *)classes propertyMappers:(NSArray *)propertyMappers

Parameters

classes

The possible classes to map to.

propertyMappers

A list of EBPropertyMapper between NSObject property names and JSON fields. See EBPropertyMapper.

Discussion

Creates a mapper instance with several possible classes and property mappers.

Declared In

EBJSONObjectMapper.h

mappedPropertyName:forClass:

The property name to search.

- (NSString *)mappedPropertyName:(NSString *)propertyName forClass:(Class)class

Parameters

propertyName

The property name to search.

class

The class to be searched.

Return Value

The mapped property name if found. Nil otherwise.

Declared In

EBJSONObjectMapper.m

objectFromJSON:

Maps a NSDictionary to a custom class.

- (id)objectFromJSON:(id)dict

Parameters

dict

The array or dictionary with the key-values representing the ivars of the object.

Return Value

an object of the specified class (See initWithClass:).

Discussion

Maps a NSDictionary to a custom class.

Declared In

EBJSONObjectMapper.h

propertyNamesForClass:

The class to be analyzed

- (NSMutableSet *)propertyNamesForClass:(Class)class

Parameters

class

The class to be analyzed

Return Value

The property names for a specified class, using the value of propertyMapper by default

Declared In

EBJSONObjectMapper.m

susceptibleClassForDict:

The most susceptible class for the dict or nil if not found at all.

- (Class)susceptibleClassForDict:(NSDictionary *)dictionary

Parameters

dictionary

The dictionary to be linked to a class.

Return Value

The most susceptible class for the dict or nil if not found at all.

Declared In

EBJSONObjectMapper.m