mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-05-07 01:41:46 +08:00
Implementation of Object Mapping 2.0 design:
* Removed RestKit from inheritance hierarchy * Mappings are implemented as concrete classes * Mapper is much more flexible & powerful * Much more robust error handling * Serialization is reimplemented as an object mapping operation * Added ability to serialize to JSON natively * Reworked Core Data integration * Simplified the codebase substantially
This commit is contained in:
31
Code/ObjectMapping/RKObjectSerializer.h
Normal file
31
Code/ObjectMapping/RKObjectSerializer.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// RKObjectSerializer.h
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 5/2/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKObjectMapping.h"
|
||||
#import "RKObjectMappingOperation.h"
|
||||
#import "../Network/RKRequestSerializable.h"
|
||||
|
||||
/**
|
||||
Performs a serialization of an object and its relationships back into
|
||||
a dictionary representation according to the mappings specified. The
|
||||
transformed object is then enclosed in an RKRequestSerializable representation
|
||||
that is suitable for inclusion in an RKRequest.
|
||||
*/
|
||||
@interface RKObjectSerializer : NSObject <RKObjectMappingOperationDelegate, RKObjectFactory> {
|
||||
id _object;
|
||||
RKObjectMapping* _mapping;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) id object;
|
||||
@property (nonatomic, readonly) RKObjectMapping* mapping;
|
||||
|
||||
+ (id)serializerWithObject:(id)object mapping:(RKObjectMapping*)mapping;
|
||||
- (id)initWithObject:(id)object mapping:(RKObjectMapping*)mapping;
|
||||
- (id<RKRequestSerializable>)serializationForMIMEType:(NSString*)mimeType error:(NSError**)error;
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user