Overhaul RKParser API's for clarity and simplicity:

* Adds support for NSJSONSerialization. closes #476
* Renames RKParser to RKSerialization
* Renames RKParserRegistry to RKMIMETypeSerialization
* Rework serialization implementations API's to use class methods
* Fold together string and regular expression matching for MIME Type registrations
* Port serialization implementations to working off of NSData instead of NSString. refs #762
* Migrate JSONKit to being an optional component. See https://github.com/RestKit/RKJSONKitSerialization
This commit is contained in:
Blake Watters
2012-09-04 13:07:31 -04:00
parent a74b8717dc
commit 10377d0a70
27 changed files with 450 additions and 549 deletions

View File

@@ -27,7 +27,7 @@
#import "RKManagedObjectMappingOperationDataSource.h"
#import "RKInMemoryManagedObjectCache.h"
#import "NSString+RKAdditions.h"
#import "RKParserRegistry.h"
#import "RKMIMETypeSerialization.h"
#import "RKLog.h"
// Set Logging Component
@@ -192,7 +192,7 @@
}
NSString *MIMEType = [path MIMETypeForPathExtension];
id parsedData = [[RKParserRegistry sharedRegistry] parseData:payload withMIMEType:MIMEType error:&localError];
id parsedData = [RKMIMETypeSerialization objectFromData:payload MIMEType:MIMEType error:&localError];
if (!parsedData) {
RKLogError(@"Failed to parse file at path '%@': %@", path, [localError localizedDescription]);
}