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]);
}

View File

@@ -25,7 +25,7 @@
#import "AFNetworking.h"
#import "RKManagedObjectRequestOperation.h"
@protocol RKParser;
@protocol RKSerialization;
@class RKManagedObjectStore, RKObjectRequestOperation, RKManagedObjectRequestOperation,
RKMappingResult, RKRequestDescriptor, RKResponseDescriptor;

View File

@@ -19,7 +19,7 @@
//
#import "RKObjectManager.h"
#import "RKObjectParameters.h"
#import "RKObjectParameterization.h"
#import "RKManagedObjectStore.h"
#import "RKSupport.h"
#import "RKRequestDescriptor.h"
@@ -227,7 +227,7 @@ static NSOperationQueue *defaultMappingQueue = nil;
RKRequestDescriptor *requestDescriptor = [self requestDescriptorForObject:object];
if (requestDescriptor) {
NSError *error = nil;
NSMutableDictionary *mergedParameters = [[RKObjectParameters parametersWithObject:object requestDescriptor:requestDescriptor error:&error] mutableCopy];
NSMutableDictionary *mergedParameters = [[RKObjectParameterization parametersWithObject:object requestDescriptor:requestDescriptor error:&error] mutableCopy];
if (parameters) [mergedParameters reverseMergeWith:parameters];
requestParameters = mergedParameters;
} else {
@@ -249,7 +249,7 @@ static NSOperationQueue *defaultMappingQueue = nil;
RKRequestDescriptor *requestDescriptor = [self requestDescriptorForObject:object];
if (requestDescriptor) {
NSError *error = nil;
NSMutableDictionary *mergedParameters = [[RKObjectParameters parametersWithObject:object requestDescriptor:requestDescriptor error:&error] mutableCopy];
NSMutableDictionary *mergedParameters = [[RKObjectParameterization parametersWithObject:object requestDescriptor:requestDescriptor error:&error] mutableCopy];
if (parameters) [mergedParameters reverseMergeWith:parameters];
requestParameters = mergedParameters;
} else {

View File

@@ -1,5 +1,5 @@
//
// RKObjectParameters.h
// RKObjectParameterization.h
// RestKit
//
// Created by Blake Watters on 5/2/11.
@@ -25,7 +25,7 @@
object into an NSDictionary representation suitable for use as the parameters of an
HTTP request.
*/
@interface RKObjectParameters : NSObject
@interface RKObjectParameterization : NSObject
/**
Returns a dictionary representation of the given object by performing object mapping using the mapping

View File

@@ -1,5 +1,5 @@
//
// RKObjectParameters.m
// RKObjectParameterization.m
// RestKit
//
// Created by Blake Watters on 5/2/11.
@@ -19,9 +19,9 @@
//
#import "RKMIMETypes.h"
#import "RKParser.h"
#import "RKObjectParameters.h"
#import "RKParserRegistry.h"
#import "RKSerialization.h"
#import "RKObjectParameterization.h"
#import "RKMIMETypeSerialization.h"
#import "RKLog.h"
#import "RKObjectMappingOperationDataSource.h"
@@ -32,7 +32,7 @@
#undef RKLogComponent
#define RKLogComponent lcl_cRestKitObjectMapping
@interface RKObjectParameters () <RKMappingOperationDelegate>
@interface RKObjectParameterization () <RKMappingOperationDelegate>
@property (nonatomic, strong) id object;
@property (nonatomic, strong) RKRequestDescriptor *requestDescriptor;
@@ -44,11 +44,11 @@
@property (nonatomic, readonly) NSString *rootKeyPath;
@end
@implementation RKObjectParameters
@implementation RKObjectParameterization
+ (NSDictionary *)parametersWithObject:(id)object requestDescriptor:(RKRequestDescriptor *)requestDescriptor error:(NSError **)error
{
RKObjectParameters *objectParameters = [[self alloc] initWithObject:object requestDescriptor:requestDescriptor];
RKObjectParameterization *objectParameters = [[self alloc] initWithObject:object requestDescriptor:requestDescriptor];
return [objectParameters mapObjectToParameters:error];
}

View File

@@ -17,13 +17,6 @@
#undef RKLogComponent
#define RKLogComponent lcl_cRestKitNetwork
// TODO: migrate into a better error home
enum {
RKUnsupportedMIMETypeError = 1000
};
static NSString * RKUnsupportedMIMETypeErrorKey = @"MIME Type";
@interface RKResponseMapperOperation ()
@property (nonatomic, strong, readwrite) NSHTTPURLResponse *response;
@property (nonatomic, strong, readwrite) NSData *data;
@@ -58,27 +51,21 @@ static NSString * RKUnsupportedMIMETypeErrorKey = @"MIME Type";
- (id)parseResponseData:(NSError **)error
{
NSString *MIMEType = [self.response MIMEType];
id<RKParser> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:MIMEType];
if (! parser) {
NSMutableDictionary *rkUserInfo = [NSMutableDictionary dictionary];
[rkUserInfo setValue:MIMEType forKey:RKUnsupportedMIMETypeErrorKey];
[rkUserInfo setValue:[NSString stringWithFormat:@"Attempted to parse response with unsupported MIME Type %@", MIMEType] forKey:NSLocalizedDescriptionKey];
[rkUserInfo setValue:NSLocalizedString(@"Attempted to parse response with unsupported MIME Type", nil) forKey:NSLocalizedFailureReasonErrorKey];
NSError *restKitError = [[NSError alloc] initWithDomain:RKErrorDomain code:RKUnsupportedMIMETypeError userInfo:rkUserInfo];
NSError *underlyingError;
id object = [RKMIMETypeSerialization objectFromData:self.data MIMEType:MIMEType error:&underlyingError];
if (! object) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
[userInfo setValue:[NSString stringWithFormat:@"Loaded an unprocessable response (%ld) with content type '%@'", (long) self.response.statusCode, MIMEType]
forKey:NSLocalizedDescriptionKey];
[userInfo setValue:[self.response URL] forKey:NSURLErrorFailingURLErrorKey];
[userInfo setValue:restKitError forKey:NSUnderlyingErrorKey];
NSError *HTTPError = [[NSError alloc] initWithDomain:RKErrorDomain code:NSURLErrorBadServerResponse userInfo:userInfo];
[userInfo setValue:underlyingError forKey:NSUnderlyingErrorKey];
NSError *HTTPError = [[NSError alloc] initWithDomain:RKErrorDomain code:NSURLErrorCannotParseResponse userInfo:userInfo];
if (error) *error = HTTPError;
return nil;
}
return [parser objectFromData:self.data error:error];
return object;
}
- (BOOL)responseMatchesMappingDescriptor:(RKResponseDescriptor *)mappingDescriptor

View File

@@ -22,7 +22,7 @@
#import "RKObjectMapping.h"
#import "RKAttributeMapping.h"
#import "RKRelationshipMapping.h"
#import "RKObjectParameters.h"
#import "RKObjectParameterization.h"
#import "RKMappingResult.h"
#import "RKObjectMapper.h"
#import "RKParserRegistry.h"
#import "RKMIMETypeSerialization.h"

View File

@@ -0,0 +1,109 @@
//
// RKMIMETypeSerialization.h
// RestKit
//
// Created by Blake Watters on 5/18/11.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "RKMIMETypes.h"
#import "RKSerialization.h"
/**
The RKMIMETypeSerialization class provides support for the registration of classes
conforming to the RKSerialization protocol by MIME Type and the serialization and
deserialization of content by MIME Type. Serialization implementations may be registered
by an exact string match (i.e. 'application/json' for a JSON serialization implementation)
or by regular expression to match MIME Type by pattern.
*/
@interface RKMIMETypeSerialization : NSObject
///-----------------------------------------------------------------------------
/// @name Managing MIME Type Registrations
///-----------------------------------------------------------------------------
/**
Registers the given serialization class to handle content for the given MIME Type identifier.
MIME Types may be given as either a string or as a regular expression that matches the MIME Types for which the
given serialization should handle. Serializations are searched in the reverse order of their registration. If a registration
is made for an already registered MIME Type, the new registration will take precedence.
@param serializationClass The class conforming to the RKSerialization protocol to be registered as handling the given MIME Type.
@param MIMETypeStringOrRegularExpression A string or regular expression specifying the MIME Type(s) that given serialization
implementation is to be registered as handling.
*/
+ (void)registerClass:(Class<RKSerialization>)serializationClass forMIMEType:(id)MIMETypeStringOrRegularExpression;
/**
Unregisters the given serialization class from handling any MIME Types.
After this method is invoked, invocations of `serializationForMIMEType:` will no longer return the unregistered
serialization class.
@param serializationClass The class conforming to the RKSerialization protocol to be unregistered.
*/
+ (void)unregisterClass:(Class<RKSerialization>)serializationClass;
/**
Returns the serialization class registered to handle the given MIME Type.
Searches the registrations in reverse order for the first serialization implementation registered to handle
the given MIME Type. Matches are determined by doing a lowercase string comparison if the MIME Type was registered
with a string identifier or by evaluating a regular expression match against the given MIME Type if registered with
a regular expression.
@param MIMEType The MIME Type for which to return the registered RKSerialization conformant class.
@return A class conforming to the RKSerialization protocol registered for the given MIME Type or nil if none was found.
*/
+ (Class<RKSerialization>)serializationClassForMIMEType:(NSString *)MIMEType;
///-----------------------------------------------------------------------------
/// @name Serializing and Deserializing Content by MIME Type
///-----------------------------------------------------------------------------
/**
Deserializes and returns a Foundation object representation of the given UTF-8 encoded data in
the serialization format for the given MIME Type.
On invocation, searches the registrations by invoking `serializationClassForMIMEType:` with the given
MIME Type and then invokes `objectFromData:error:` on the RKSerialization conformant class returned. If
no serialization implementation is found to handle the given MIME Type, nil is returned and the given
error pointer will be set to an NSError object with the `RKMissingSerializationForMIMETypeError` code.
@param data The UTF-8 encoded data representation of the object to be deserialized.
@param MIMEType The MIME Type of the serialization format the data is in.
@param error A pointer to an NSError object.
@return A Foundation object from the serialized data in data, or nil if an error occurs.
*/
+ (id)objectFromData:(NSData *)data MIMEType:(NSString *)MIMEType error:(NSError **)error;
/**
Serializes and returns a UTF-8 encoded data representation of the given Foundation
object in the serialization format for the given MIME Type.
On invocation, searches the registrations by invoking `serializationClassForMIMEType:` with the given
MIME Type and then invokes `objectFromData:error:` on the RKSerialization conformant class returned. If
no serialization implementation is found to handle the given MIME Type, nil is returned and the given
error pointer will be set to an NSError object with the `RKMissingSerializationForMIMETypeError` code.
@param data The UTF-8 encoded data representation of the object to be deserialized.
@param MIMEType The MIME Type of the serialization format the data is in.
@param error A pointer to an NSError object.
@return A Foundation object from the serialized data in data, or nil if an error occurs.
*/
+ (NSData *)dataFromObject:(id)object MIMEType:(NSString *)MIMEType error:(NSError **)error;
@end

View File

@@ -0,0 +1,178 @@
//
// RKMIMETypeSerialization.m
// RestKit
//
// Created by Blake Watters on 5/18/11.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "RKMIMETypeSerialization.h"
#import "RKErrors.h"
#import "RKSerialization.h"
#import "RKLog.h"
// Define logging component
#undef RKLogComponent
#define RKLogComponent lcl_cRestKitSupport
@interface RKMIMETypeSerializationRegistration : NSObject
@property (nonatomic, strong) id MIMETypeStringOrRegularExpression;
@property (nonatomic, assign) Class<RKSerialization> serializationClass;
- (id)initWithMIMEType:(id)MIMETypeStringOrRegularExpression serializationClass:(Class<RKSerialization>)serializationClass;
- (BOOL)matchesMIMEType:(NSString *)MIMEType;
@end
@implementation RKMIMETypeSerializationRegistration
- (id)initWithMIMEType:(id)MIMETypeStringOrRegularExpression serializationClass:(Class<RKSerialization>)serializationClass
{
NSParameterAssert(MIMETypeStringOrRegularExpression);
NSParameterAssert(serializationClass);
NSAssert([MIMETypeStringOrRegularExpression isKindOfClass:[NSString class]]
|| [MIMETypeStringOrRegularExpression isKindOfClass:[NSRegularExpression class]],
@"Can only register a serialization class for a MIME Type by string or regular expression.");
self = [super init];
if (self) {
self.MIMETypeStringOrRegularExpression = MIMETypeStringOrRegularExpression;
self.serializationClass = serializationClass;
}
return self;
}
- (BOOL)matchesMIMEType:(NSString *)MIMEType
{
if ([self.MIMETypeStringOrRegularExpression isKindOfClass:[NSString class]]) {
return [[MIMEType lowercaseString] isEqualToString:[self.MIMETypeStringOrRegularExpression lowercaseString]];
} else if ([self.MIMETypeStringOrRegularExpression isKindOfClass:[NSRegularExpression class]]) {
NSRegularExpression *regex = (NSRegularExpression *) self.MIMETypeStringOrRegularExpression;
NSUInteger numberOfMatches = [regex numberOfMatchesInString:[MIMEType lowercaseString] options:0 range:NSMakeRange(0, [MIMEType length])];
return numberOfMatches > 0;
} else {
@throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Unable to evaluate match for MIME Type '%@': expected an NSSt" userInfo:nil];
}
}
@end
@interface RKMIMETypeSerialization ()
@property (nonatomic, strong) NSMutableArray *registrations;
@end
@implementation RKMIMETypeSerialization
+ (RKMIMETypeSerialization *)sharedSerialization {
static RKMIMETypeSerialization *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[RKMIMETypeSerialization alloc] init];
[sharedInstance addRegistrationsForKnownSerializations];
});
return sharedInstance;
}
- (id)init {
self = [super init];
if (self) {
self.registrations = [NSMutableArray new];
}
return self;
}
- (void)addRegistrationsForKnownSerializations {
Class serializationClass = nil;
// JSON
NSArray *JSONSerializationClassNames = @[ @"RKNSJSONSerialization", @"RKJSONKitSerialization" ];
for (NSString *serializationClassName in JSONSerializationClassNames) {
serializationClass = NSClassFromString(serializationClassName);
if (serializationClass) {
RKLogInfo(@"JSON Serialization class '%@' detected: Registering for MIME Type '%@", serializationClassName, RKMIMETypeJSON);
[self.registrations addObject:[[RKMIMETypeSerializationRegistration alloc] initWithMIMEType:RKMIMETypeJSON serializationClass:serializationClass]];
}
}
// XML
// parserClass = NSClassFromString(@"RKXMLParserXMLReader");
// if (parserClass) {
// [self setParserClass:parserClass forMIMEType:RKMIMETypeXML];
// [self setParserClass:parserClass forMIMEType:RKMIMETypeTextXML];
// }
}
#pragma mark - Public
+ (Class<RKSerialization>)serializationClassForMIMEType:(NSString *)MIMEType
{
for (RKMIMETypeSerializationRegistration *registration in [[self sharedSerialization].registrations reverseObjectEnumerator]) {
if ([registration matchesMIMEType:MIMEType]) {
return registration.serializationClass;
}
}
return nil;
}
+ (void)registerClass:(Class<RKSerialization>)serializationClass forMIMEType:(id)MIMETypeStringOrRegularExpression
{
RKMIMETypeSerializationRegistration *registration = [[RKMIMETypeSerializationRegistration alloc] initWithMIMEType:MIMETypeStringOrRegularExpression serializationClass:serializationClass];
[[self sharedSerialization].registrations addObject:registration];
}
+ (void)unregisterClass:(Class<RKSerialization>)serializationClass
{
NSArray *registrationsCopy = [[self sharedSerialization].registrations copy];
for (RKMIMETypeSerializationRegistration *registration in registrationsCopy) {
if (registration.class == serializationClass) {
[[self sharedSerialization].registrations removeObject:registration];
}
}
}
+ (id)objectFromData:(NSData *)data MIMEType:(NSString *)MIMEType error:(NSError **)error
{
Class<RKSerialization> serializationClass = [self serializationClassForMIMEType:MIMEType];
if (!serializationClass) {
if (error) {
NSString* errorMessage = [NSString stringWithFormat:@"Cannot deserialize data: No serialization registered for MIME Type '%@'", MIMEType];
NSDictionary *userInfo = @{ NSLocalizedDescriptionKey : errorMessage, RKMIMETypeErrorKey : MIMEType };
*error = [NSError errorWithDomain:RKErrorDomain code:RKUnsupportedMIMETypeError userInfo:userInfo];
}
return nil;
}
return [serializationClass objectFromData:data error:error];
}
+ (id)dataFromObject:(id)object MIMEType:(NSString *)MIMEType error:(NSError **)error
{
Class<RKSerialization> serializationClass = [self serializationClassForMIMEType:MIMEType];
if (!serializationClass) {
if (error) {
NSString* errorMessage = [NSString stringWithFormat:@"Cannot deserialize data: No serialization registered for MIME Type '%@'", MIMEType];
NSDictionary *userInfo = @{ NSLocalizedDescriptionKey : errorMessage, RKMIMETypeErrorKey : MIMEType };
*error = [NSError errorWithDomain:RKErrorDomain code:RKUnsupportedMIMETypeError userInfo:userInfo];
}
return nil;
}
return [serializationClass dataFromObject:object error:error];
}
@end

View File

@@ -1,153 +0,0 @@
//
// RKParserRegistry.h
// RestKit
//
// Created by Blake Watters on 5/18/11.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "RKMIMETypes.h"
#import "RKParser.h"
/**
RKParserRegistry provides for the registration of RKParser classes
that handle parsing/serializing for content by MIME Type. Registration
is configured via exact string matches (i.e. application/json) or via regular
expression.
*/
@interface RKParserRegistry : NSObject {
NSMutableDictionary *_MIMETypeToParserClasses;
NSMutableArray *_MIMETypeToParserClassesRegularExpressions;
NSData *_whitespaceData;
}
/**
Return the global shared singleton registry for MIME Type to Parsers
@return The global shared RKParserRegistry instance.
*/
+ (RKParserRegistry *)sharedRegistry;
/**
Sets the global shared registry singleton to a new instance of RKParserRegistry
@param registry A new parser registry object to configure as the shared instance.
*/
+ (void)setSharedRegistry:(RKParserRegistry *)registry;
/**
Returns the parsed data by delegating to a registered parser for the specified
MIME type.
If the data cannot be handled directly by the parser, it is first converted to
a string and subsequently passed to the parser.
@param data The data to be parsed.
@param MIMEType The MIME Type of the content to be parsed.
@param encoding The NSStringEncoding to use when converting the data to string.
@param error A pointer to an NSError object.
@return The parsed object or nil if an error occurred during parsing.
*/
- (id)parseData:(NSData *)data withMIMEType:(NSString *)MIMEType encoding:(NSStringEncoding)encoding error:(NSError **)error;
/**
Returns the parsed data by delegating to a registered parser for the specified
MIME type.
This simply invokes parseData:withMIMEType:encoding:error: with a NSUTF8StringEncoding.
@param data The data to be parsed.
@param MIMEType The MIME Type of the content to be parsed.
@param error A pointer to an NSError object.
@return The parsed object or nil if an error occurred during parsing.
*/
- (id)parseData:(NSData *)data withMIMEType:(NSString *)MIMEType error:(NSError **)error;
/**
Returns the serialized data by delegating to a registered parser for the specified
MIME type.
If the parser is only able to serialize to string, the serialized string will
be converted to NSData.
@param object The object to be serialized.
@param MIMEType The desired MIME Type for the serialized output.
@param error A pointer to an NSError object.
@return The serialized object or nil if an error occurred during serialization.
*/
- (NSData *)serializeObject:(id)object forMIMEType:(NSString *)MIMEType error:(NSError **)error;
/**
Returns an instance of the RKParser conformant class registered to handle content
with the given MIME Type.
MIME Types are searched in the order in which they are registered and exact
string matches are favored over regular expressions.
@param MIMEType The MIME Type of the content to be parsed/serialized.
@return An instance of the RKParser conformant class registered to handle the given MIME Type.
*/
- (id<RKParser>)parserForMIMEType:(NSString *)MIMEType;
/**
Returns an instance of the RKParser conformant class registered to handle content
with the given MIME Type.
MIME Types are searched in the order in which they are registered and exact
string matches are favored over regular expressions.
@param MIMEType The MIME Type of the content to be parsed/serialized.
@return The RKParser conformant class registered to handle the given MIME Type.
*/
- (Class<RKParser>)parserClassForMIMEType:(NSString *)MIMEType;
/**
Registers an RKParser conformant class as the handler for MIME Types exactly matching the
specified MIME Type string.
@param parserClass The RKParser conformant class to instantiate when parsing/serializing MIME Types matching MIMETypeExpression.
@param MIMEType A MIME Type string for which instances of parserClass should be used for parsing/serialization.
*/
- (void)setParserClass:(Class<RKParser>)parserClass forMIMEType:(NSString *)MIMEType;
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
/**
Registers an RKParser conformant class as the handler for MIME Types matching the
specified regular expression.
@param parserClass The RKParser conformant class to instantiate when parsing/serializing MIME Types matching MIMETypeExpression.
@param MIMETypeRegex A regular expression that matches MIME Types that should be handled by instances of parserClass.
*/
- (void)setParserClass:(Class<RKParser>)parserClass forMIMETypeRegularExpression:(NSRegularExpression *)MIMETypeRegex;
#endif
/**
Returns wether the registry has a registered parser for that MIME type.
@param MIMEType The MIME type to test if it is parsable.
@return YES if a registered parser for that MIME type is registered, NO otherwise.
*/
- (BOOL)canParseMIMEType:(NSString*)MIMEType;
/**
Automatically configure the registry via run-time reflection of the RKParser classes
available that ship with RestKit. This happens automatically when the shared registry
singleton is initialized and makes configuration transparent to users.
*/
- (void)autoconfigure;
@end

View File

@@ -1,160 +0,0 @@
//
// RKParserRegistry.m
// RestKit
//
// Created by Blake Watters on 5/18/11.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "RKParserRegistry.h"
#import "RKErrors.h"
RKParserRegistry *gSharedRegistry;
@implementation RKParserRegistry
+ (RKParserRegistry *)sharedRegistry {
if (gSharedRegistry == nil) {
gSharedRegistry = [RKParserRegistry new];
[gSharedRegistry autoconfigure];
}
return gSharedRegistry;
}
+ (void)setSharedRegistry:(RKParserRegistry *)registry {
gSharedRegistry = registry;
}
- (id)init {
self = [super init];
if (self) {
_MIMETypeToParserClasses = [[NSMutableDictionary alloc] init];
_MIMETypeToParserClassesRegularExpressions = [[NSMutableArray alloc] init];
_whitespaceData = [[NSData alloc] initWithBytes:" " length:1];
}
return self;
}
- (id)parseData:(NSData *)data withMIMEType:(NSString *)MIMEType encoding:(NSStringEncoding)encoding error:(NSError **)error {
// Handle empty data and data containing a single whitespace character:
NSUInteger length = [data length];
if (length == 0 || (length == 1 && [data isEqualToData:_whitespaceData])) {
if (error) {
NSString* errorMessage = [NSString stringWithFormat:@"Attemped to parse empty data for MIME Type '%@'", MIMEType];
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:errorMessage, NSLocalizedDescriptionKey, nil];
*error = [NSError errorWithDomain:RKErrorDomain code:RKParserRegistryEmptyDataError userInfo:userInfo];
}
return nil;
}
id<RKParser> parser = [self parserForMIMEType:MIMEType];
if (!parser) {
if (error) {
NSString* errorMessage = [NSString stringWithFormat:@"Cannot parse data without a parser for MIME Type '%@'", MIMEType];
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:errorMessage, NSLocalizedDescriptionKey, nil];
*error = [NSError errorWithDomain:RKErrorDomain code:RKParserRegistryMissingParserError userInfo:userInfo];
}
return nil;
}
return [parser objectFromData:data error:error];
}
- (id)parseData:(NSData *)data withMIMEType:(NSString *)MIMEType error:(NSError **)error {
return [self parseData:data withMIMEType:MIMEType encoding:NSUTF8StringEncoding error:error];
}
- (NSData *)serializeObject:(id)object forMIMEType:(NSString *)MIMEType error:(NSError **)error {
id<RKParser> parser = [self parserForMIMEType:MIMEType];
if (!parser) {
if (error) {
NSString* errorMessage = [NSString stringWithFormat:@"Cannot serialize object without a parser for MIME Type '%@'", MIMEType];
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:errorMessage, NSLocalizedDescriptionKey, nil];
*error = [NSError errorWithDomain:RKErrorDomain code:RKParserRegistryMissingParserError userInfo:userInfo];
}
return nil;
}
return [parser dataFromObject:object error:error];
}
- (Class<RKParser>)parserClassForMIMEType:(NSString *)MIMEType {
id parserClass = [_MIMETypeToParserClasses objectForKey:MIMEType];
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
if (!parserClass)
{
for (NSArray *regexAndClass in _MIMETypeToParserClassesRegularExpressions) {
NSRegularExpression *regex = [regexAndClass objectAtIndex:0];
NSUInteger numberOfMatches = [regex numberOfMatchesInString:MIMEType options:0 range:NSMakeRange(0, [MIMEType length])];
if (numberOfMatches) {
parserClass = [regexAndClass objectAtIndex:1];
break;
}
}
}
#endif
return parserClass;
}
- (void)setParserClass:(Class<RKParser>)parserClass forMIMEType:(NSString *)MIMEType {
[_MIMETypeToParserClasses setObject:parserClass forKey:MIMEType];
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
- (void)setParserClass:(Class<RKParser>)parserClass forMIMETypeRegularExpression:(NSRegularExpression *)MIMETypeRegex {
NSArray *expressionAndClass = [NSArray arrayWithObjects:MIMETypeRegex, parserClass, nil];
[_MIMETypeToParserClassesRegularExpressions addObject:expressionAndClass];
}
#endif
- (id<RKParser>)parserForMIMEType:(NSString *)MIMEType {
Class parserClass = [self parserClassForMIMEType:MIMEType];
if (parserClass) {
return [[parserClass alloc] init];
}
return nil;
}
- (BOOL)canParseMIMEType:(NSString*)MIMEType {
return [self parserClassForMIMEType:MIMEType] != nil;
}
- (void)autoconfigure {
Class parserClass = nil;
// JSON
NSSet *JSONParserClassNames = [NSSet setWithObjects:@"RKJSONParserJSONKit", @"RKJSONParserYAJL", @"RKJSONParserSBJSON", @"RKJSONParserNXJSON", nil];
for (NSString *parserClassName in JSONParserClassNames) {
parserClass = NSClassFromString(parserClassName);
if (parserClass) {
[self setParserClass:parserClass forMIMEType:RKMIMETypeJSON];
break;
}
}
// XML
parserClass = NSClassFromString(@"RKXMLParserXMLReader");
if (parserClass) {
[self setParserClass:parserClass forMIMEType:RKMIMETypeXML];
[self setParserClass:parserClass forMIMEType:RKMIMETypeTextXML];
}
}
@end

View File

@@ -21,8 +21,8 @@
#import "NSBundle+RKAdditions.h"
#import "NSString+RKAdditions.h"
#import "RKLog.h"
#import "RKParser.h"
#import "RKParserRegistry.h"
#import "RKSerialization.h"
#import "RKMIMETypeSerialization.h"
@implementation NSBundle (RKAdditions)
@@ -67,10 +67,10 @@
- (id)parsedObjectWithContentsOfResource:(NSString *)name withExtension:(NSString *)extension
{
NSError *error = nil;
NSData* resourceContents = [self dataWithContentsOfResource:name withExtension:extension];
NSData *resourceContents = [self dataWithContentsOfResource:name withExtension:extension];
NSString *MIMEType = [self MIMETypeForResource:name withExtension:extension];
id object = [[RKParserRegistry sharedRegistry] parseData:resourceContents withMIMEType:MIMEType error:&error];
id object = [RKMIMETypeSerialization objectFromData:resourceContents MIMEType:MIMEType error:&error];
if (object == nil) {
RKLogCritical(@"%@ Failed to parse resource with name '%@' and extension '%@'. Error: %@", self, name, extension, [error localizedDescription]);
return nil;

View File

@@ -1,26 +0,0 @@
//
// RKJSONParserJSONKit.h
// RestKit
//
// Created by Blake Watters on 5/14/11.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "RKParser.h"
@interface RKJSONParserJSONKit : NSObject <RKParser> {
}
@end

View File

@@ -1,42 +0,0 @@
//
// RKJSONParserJSONKit.m
// RestKit
//
// Created by Jeff Arena on 3/16/10.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "RKJSONParserJSONKit.h"
#import "JSONKit.h"
#import "RKLog.h"
// Set Logging Component
#undef RKLogComponent
#define RKLogComponent lcl_cRestKitSupportParsers
// TODO: JSONKit serializer instance should be reused to leverage
// the internal caching capabilities from the JSONKit serializer
@implementation RKJSONParserJSONKit
- (id)objectFromData:(NSData *)data error:(NSError **)error {
return [data objectFromJSONDataWithParseOptions:JKParseOptionStrict error:error];
}
- (NSData *)dataFromObject:(id)object error:(NSError **)error {
return [object JSONDataWithOptions:JKSerializeOptionNone error:error];
}
@end

View File

@@ -31,10 +31,11 @@ typedef enum {
RKRequestUnexpectedResponseError = 3,
RKObjectLoaderUnexpectedResponseError = 4,
RKRequestConnectionTimeoutError = 5,
RKParserRegistryMissingParserError = 6,
RKUnsupportedMIMETypeError = 6,
RKParserRegistryEmptyDataError = 7
} RKRestKitError;
/** @name Error Constants */
/**
@@ -55,3 +56,5 @@ extern NSString * const RKErrorNotificationErrorKey;
extern NSString * const RKObjectMapperErrorObjectsKey;
extern NSString * const RKDetailedErrorsKey; // When multiple errors occur, they are stored in a composite error
extern NSString * const RKMIMETypeErrorKey;

View File

@@ -25,3 +25,4 @@ NSString * const RKErrorDomain = @"org.restkit.RestKit.ErrorDomain";
NSString * const RKObjectMapperErrorObjectsKey = @"RKObjectMapperErrorObjectsKey";
NSString * const RKErrorNotificationErrorKey = @"error";
NSString * const RKDetailedErrorsKey = @"DetailedErrors";
NSString * const RKMIMETypeErrorKey = @"MIME Type";

View File

@@ -0,0 +1,12 @@
//
// RKNSJSONSerialization.h
// RestKit
//
// Created by Blake Watters on 8/31/12.
// Copyright (c) 2012 RestKit. All rights reserved.
//
#import "RKSerialization.h"
@interface RKNSJSONSerialization : NSObject <RKSerialization>
@end

View File

@@ -0,0 +1,23 @@
//
// RKNSJSONSerialization.m
// RestKit
//
// Created by Blake Watters on 8/31/12.
// Copyright (c) 2012 RestKit. All rights reserved.
//
#import "RKNSJSONSerialization.h"
@implementation RKNSJSONSerialization
+ (id)objectFromData:(NSData *)data error:(NSError **)error
{
return [NSJSONSerialization JSONObjectWithData:data options:0 error:error];
}
+ (NSData *)dataFromObject:(id)object error:(NSError **)error
{
return [NSJSONSerialization dataWithJSONObject:object options:0 error:error];
}
@end

View File

@@ -1,49 +0,0 @@
//
// RKParser.h
// RestKit
//
// Created by Blake Watters on 10/1/10.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/**
The RKParser protocol declares two methods that a class must implement
so that it can provide support for parsing and serializing objects
to and from data representations and are configured via the
RKParserRegistry shared instance.
*/
@protocol RKParser <NSObject>
/**
Returns an object representation of the source data encoded in the
format provided by the parser (i.e. JSON, XML, etc).
@param data The data representation of the object to be parsed encoded in UTF-8.
@param error A pointer to an NSError object.
@return The parsed object or nil if an error occurred during parsing.
*/
- (id)objectFromData:(NSData *)data error:(NSError **)error;
/**
Returns a data representation encoded in the format
provided by the parser (i.e. JSON, XML, etc) for the given object.
@param object The object to be serialized.
@param A pointer to an NSError object.
@return A data representation of the serialized object encoded in UTF-8 or nil if an error occurred.
*/
- (NSData *)dataFromObject:(id)object error:(NSError **)error;
@end

View File

@@ -0,0 +1,52 @@
//
// RKCoding.h
// RestKit
//
// Created by Blake Watters on 10/1/10.
// Copyright (c) 2009-2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/**
The RKSerialization protocol declares two methods that a class must implement
so that it can provide support for serializing objects to and deserializing objects
from UTF-8 encoded data representations of a serialization format such as JSON
or XML. Serialization implementations typically handle data in a given MIME Type
(i.e. application/json) and may be registered with the RKCoder class.
@see RKMIMETypeSerialization
*/
@protocol RKSerialization <NSObject>
/**
Deserializes and returns the given data in the format supported by the receiver
(i.e. JSON, XML, etc) as a Foundation object representation.
@param data The UTF-8 encoded data representation of the object to be deserialized.
@param error A pointer to an NSError object.
@return A Foundation object from the serialized data in data, or nil if an error occurs.
*/
+ (id)objectFromData:(NSData *)data error:(NSError **)error;
/**
Serializes and returns a UTF-8 encoded data representation of the given Foundation
object in the format supported by the receiver (i.e. JSON, XML, etc).
@param object The object to be serialized.
@param A pointer to an NSError object.
@return A data representation of the given object in UTF-8 encoding, or nil if an error occurred.
*/
+ (NSData *)dataFromObject:(id)object error:(NSError **)error;
@end

View File

@@ -25,6 +25,7 @@
#import "RKPathMatcher.h"
#import "RKDotNetDateFormatter.h"
#import "RKDirectoryUtilities.h"
#import "RKNSJSONSerialization.h"
// Load our categories
#import "NSDictionary+RKAdditions.h"

View File

@@ -60,7 +60,6 @@ _lcl_component(RestKitCoreDataCache, "restkit.core_data.cache",
_lcl_component(RestKitCoreDataSearchEngine, "restkit.core_data.search_engine", "RestKit/CoreData/SearchEngine")
_lcl_component(RestKitSupport, "restkit.support", "RestKit/Support")
_lcl_component(RestKitSupportParsers, "restkit.support.parsers", "RestKit/Support/Parsers")
_lcl_component(RestKitThree20, "restkit.three20", "RestKit/Three20")
_lcl_component(RestKitUI, "restkit.ui", "RestKit/UI")
_lcl_component(RestKitTesting, "restkit.testing", "RestKit/Testing")
_lcl_component(RestKitSearch, "restkit.search", "RestKit/Search")

View File

@@ -88,8 +88,8 @@ RestKit is broken into several modules that cleanly separate the mapping engine
<td>Describes an object mappable response that may be returned from a remote web application in terms of an object mapping, a key path, a <a href="">SOCKit pattern</a> for matching the URL, and a set of status codes that define the circumstances in which the mapping is appropriate for a given response.</td>
</tr>
<tr>
<td><a href="http://restkit.org/api/0.20.0/Classes/RKObjectParameters.html">RKObjectParameters</a></td>
<td>Performs serialization of a given object into an <tt>NSDictionary</tt> represenation suitable for use as the parameters of an HTTP request.</td>
<td><a href="http://restkit.org/api/0.20.0/Classes/RKObjectParameterization.html">RKObjectParameterization</a></td>
<td>Performs mapping of a given object into an <tt>NSDictionary</tt> represenation suitable for use as the parameters of an HTTP request.</td>
</tr>
<tr>
<td><a href="http://restkit.org/api/0.20.0/Classes/RKObjectRequestOperation.html">RKObjectRequestOperation</a></td>
@@ -449,13 +449,13 @@ As of [version 0.20.0](https://github.com/RestKit/RestKit/wiki/Restkit-0.20.0),
If you are including the RestKit sources directly into a project that does not yet use [Automatic Reference Counting](http://clang.llvm.org/docs/AutomaticReferenceCounting.html), you will need to set the `-fobjc-arc` compiler flag on all of the RestKit source files. To do this in Xcode, go to your active target and select the "Build Phases" tab. Now select all RestKit source files, press Enter, insert `-fobjc-arc` and then "Done" to enable ARC for RestKit.
### Document Coders
### Serialization Formats
RestKit provides a pluggable interface for handling arbitrary document formats via the `[RKCoding](http://restkit.org/api/0.20.0/Classes/RKCoding.html)` protocol and the `[RKCoder](http://restkit.org/api/0.20.0/Classes/RKCoder.html)` class. Out of the box, RestKit supports handling the [JSON](http://www.json.org/) format for serializing and deserializing object representations via the [`NSJSONSerialization`](http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html) class.
RestKit provides a pluggable interface for handling arbitrary serialization formats via the `[RKSerialization](http://restkit.org/api/0.20.0/Classes/RKSerialization.html)` protocol and the `[RKMIMETypeSerialization](http://restkit.org/api/0.20.0/Classes/RKMIMETypeSerialization.html)` class. Out of the box, RestKit supports handling the [JSON](http://www.json.org/) format for serializing and deserializing object representations via the [`NSJSONSerialization`](http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html) class.
#### Additional Coders
#### Additional Serializations
Support for additional formats and alternate coding backends is provided via external modules that can be added to the project. Currently the following coders are available for use:
Support for additional formats and alternate serialization backends is provided via external modules that can be added to the project. Currently the following serialization implementations are available for use:
* JSONKit
* SBJSON

View File

@@ -15,7 +15,6 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.7'
s.dependency 'RestKit/Network'
s.dependency 'RestKit/JSONKit'
s.dependency 'RestKit/ObjectMapping'
s.dependency 'RestKit/ObjectMapping/CoreData'
s.dependency 'RestKit/Search'
@@ -30,11 +29,6 @@ Pod::Spec.new do |s|
ns.dependency 'LibComponentLogging-NSLog', '>= 1.0.4'
ns.dependency 'SOCKit'
ns.dependency 'AFNetworking', '1.0RC1'
end
s.subspec 'JSONKit' do |jos|
jos.source_files = 'Code/Support/Parsers/JSON/RKJSONParserJSONKit.{h,m}'
jos.dependency 'JSONKit', '>= 1.5pre'
end
s.subspec 'ObjectMapping' do |os|

View File

@@ -90,8 +90,8 @@
25160E24145650490060A5C5 /* RKPropertyInspector.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160D97145650490060A5C5 /* RKPropertyInspector.m */; };
25160E25145650490060A5C5 /* RKRelationshipMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160D98145650490060A5C5 /* RKRelationshipMapping.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E26145650490060A5C5 /* RKRelationshipMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160D99145650490060A5C5 /* RKRelationshipMapping.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
25160E2B145650490060A5C5 /* RKParserRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160D9E145650490060A5C5 /* RKParserRegistry.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E2C145650490060A5C5 /* RKParserRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160D9F145650490060A5C5 /* RKParserRegistry.m */; };
25160E2B145650490060A5C5 /* RKMIMETypeSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160D9E145650490060A5C5 /* RKMIMETypeSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E2C145650490060A5C5 /* RKMIMETypeSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160D9F145650490060A5C5 /* RKMIMETypeSerialization.m */; };
25160E2E145650490060A5C5 /* RestKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DA1145650490060A5C5 /* RestKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E31145650490060A5C5 /* lcl_config_components.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DA5145650490060A5C5 /* lcl_config_components.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E32145650490060A5C5 /* lcl_config_extensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DA6145650490060A5C5 /* lcl_config_extensions.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -102,8 +102,6 @@
25160E37145650490060A5C5 /* NSString+RKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DAB145650490060A5C5 /* NSString+RKAdditions.m */; };
25160E38145650490060A5C5 /* NSURL+RKAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DAC145650490060A5C5 /* NSURL+RKAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E39145650490060A5C5 /* NSURL+RKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DAD145650490060A5C5 /* NSURL+RKAdditions.m */; };
25160E3A145650490060A5C5 /* RKJSONParserJSONKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DB0145650490060A5C5 /* RKJSONParserJSONKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E3B145650490060A5C5 /* RKJSONParserJSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DB1145650490060A5C5 /* RKJSONParserJSONKit.m */; };
25160E44145650490060A5C5 /* RestKit-Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 25160DBB145650490060A5C5 /* RestKit-Prefix.pch */; settings = {ATTRIBUTES = (Public, ); }; };
25160E47145650490060A5C5 /* RKDotNetDateFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DBE145650490060A5C5 /* RKDotNetDateFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E48145650490060A5C5 /* RKDotNetDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DBF145650490060A5C5 /* RKDotNetDateFormatter.m */; };
@@ -111,7 +109,7 @@
25160E4B145650490060A5C5 /* RKLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DC2145650490060A5C5 /* RKLog.m */; };
25160E4C145650490060A5C5 /* RKMIMETypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DC3145650490060A5C5 /* RKMIMETypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E4D145650490060A5C5 /* RKMIMETypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DC4145650490060A5C5 /* RKMIMETypes.m */; };
25160E4E145650490060A5C5 /* RKParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DC5145650490060A5C5 /* RKParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E4E145650490060A5C5 /* RKSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DC5145650490060A5C5 /* RKSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E4F145650490060A5C5 /* RKPathMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DC6145650490060A5C5 /* RKPathMatcher.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160E50145650490060A5C5 /* RKPathMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DC7145650490060A5C5 /* RKPathMatcher.m */; };
25160E53145650490060A5C5 /* RKSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DCA145650490060A5C5 /* RKSupport.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -165,8 +163,8 @@
25160F5F145655C60060A5C5 /* RKPropertyInspector.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160D97145650490060A5C5 /* RKPropertyInspector.m */; };
25160F60145655C60060A5C5 /* RKRelationshipMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160D98145650490060A5C5 /* RKRelationshipMapping.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F61145655C60060A5C5 /* RKRelationshipMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160D99145650490060A5C5 /* RKRelationshipMapping.m */; };
25160F66145655C60060A5C5 /* RKParserRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160D9E145650490060A5C5 /* RKParserRegistry.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F67145655C60060A5C5 /* RKParserRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160D9F145650490060A5C5 /* RKParserRegistry.m */; };
25160F66145655C60060A5C5 /* RKMIMETypeSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160D9E145650490060A5C5 /* RKMIMETypeSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F67145655C60060A5C5 /* RKMIMETypeSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160D9F145650490060A5C5 /* RKMIMETypeSerialization.m */; };
25160F69145655D10060A5C5 /* RKCoreData.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160D46145650490060A5C5 /* RKCoreData.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F6F145655D10060A5C5 /* RKEntityMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160D4C145650490060A5C5 /* RKEntityMapping.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F70145655D10060A5C5 /* RKEntityMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160D4D145650490060A5C5 /* RKEntityMapping.m */; };
@@ -197,12 +195,10 @@
25160F941456576C0060A5C5 /* RKLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DC2145650490060A5C5 /* RKLog.m */; };
25160F951456576C0060A5C5 /* RKMIMETypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DC3145650490060A5C5 /* RKMIMETypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F961456576C0060A5C5 /* RKMIMETypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DC4145650490060A5C5 /* RKMIMETypes.m */; };
25160F971456576C0060A5C5 /* RKParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DC5145650490060A5C5 /* RKParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F971456576C0060A5C5 /* RKSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DC5145650490060A5C5 /* RKSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F981456576C0060A5C5 /* RKPathMatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DC6145650490060A5C5 /* RKPathMatcher.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F991456576C0060A5C5 /* RKPathMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DC7145650490060A5C5 /* RKPathMatcher.m */; };
25160F9C1456576C0060A5C5 /* RKSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DCA145650490060A5C5 /* RKSupport.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F9E1456577F0060A5C5 /* RKJSONParserJSONKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 25160DB0145650490060A5C5 /* RKJSONParserJSONKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
25160F9F1456577F0060A5C5 /* RKJSONParserJSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160DB1145650490060A5C5 /* RKJSONParserJSONKit.m */; };
251610601456F2330060A5C5 /* RKManagedObjectStoreTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160FCB1456F2330060A5C5 /* RKManagedObjectStoreTest.m */; };
251610611456F2330060A5C5 /* RKManagedObjectStoreTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160FCB1456F2330060A5C5 /* RKManagedObjectStoreTest.m */; };
251610621456F2330060A5C5 /* RKManagedObjectThreadSafeInvocationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 25160FCC1456F2330060A5C5 /* RKManagedObjectThreadSafeInvocationTest.m */; };
@@ -362,8 +358,8 @@
252EFB2914DA0689004863C8 /* NakedEvents.json in Resources */ = {isa = PBXBuildFile; fileRef = 252EFB2714DA0689004863C8 /* NakedEvents.json */; };
253B495214E35D1A00B0483F /* RKTestFixture.h in Headers */ = {isa = PBXBuildFile; fileRef = 252EFB2014D9B35D004863C8 /* RKTestFixture.h */; settings = {ATTRIBUTES = (Public, ); }; };
253B495F14E35EC300B0483F /* RKTestFixture.m in Sources */ = {isa = PBXBuildFile; fileRef = 252EFB2114D9B35D004863C8 /* RKTestFixture.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
254372A815F54995006E8424 /* RKObjectParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 254372A615F54995006E8424 /* RKObjectParameters.h */; };
254372A915F54995006E8424 /* RKObjectParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 254372A715F54995006E8424 /* RKObjectParameters.m */; };
254372A815F54995006E8424 /* RKObjectParameterization.h in Headers */ = {isa = PBXBuildFile; fileRef = 254372A615F54995006E8424 /* RKObjectParameterization.h */; };
254372A915F54995006E8424 /* RKObjectParameterization.m in Sources */ = {isa = PBXBuildFile; fileRef = 254372A715F54995006E8424 /* RKObjectParameterization.m */; };
254372B815F54C3F006E8424 /* RKHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 254372AA15F54C3F006E8424 /* RKHTTPRequestOperation.h */; };
254372B915F54C3F006E8424 /* RKHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 254372AA15F54C3F006E8424 /* RKHTTPRequestOperation.h */; };
254372BA15F54C3F006E8424 /* RKHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 254372AB15F54C3F006E8424 /* RKHTTPRequestOperation.m */; };
@@ -733,8 +729,8 @@
25160D97145650490060A5C5 /* RKPropertyInspector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKPropertyInspector.m; sourceTree = "<group>"; };
25160D98145650490060A5C5 /* RKRelationshipMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKRelationshipMapping.h; sourceTree = "<group>"; };
25160D99145650490060A5C5 /* RKRelationshipMapping.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKRelationshipMapping.m; sourceTree = "<group>"; };
25160D9E145650490060A5C5 /* RKParserRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKParserRegistry.h; sourceTree = "<group>"; };
25160D9F145650490060A5C5 /* RKParserRegistry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKParserRegistry.m; sourceTree = "<group>"; };
25160D9E145650490060A5C5 /* RKMIMETypeSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKMIMETypeSerialization.h; sourceTree = "<group>"; };
25160D9F145650490060A5C5 /* RKMIMETypeSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKMIMETypeSerialization.m; sourceTree = "<group>"; };
25160DA1145650490060A5C5 /* RestKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RestKit.h; sourceTree = "<group>"; };
25160DA5145650490060A5C5 /* lcl_config_components.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lcl_config_components.h; sourceTree = "<group>"; };
25160DA6145650490060A5C5 /* lcl_config_extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lcl_config_extensions.h; sourceTree = "<group>"; };
@@ -745,8 +741,6 @@
25160DAB145650490060A5C5 /* NSString+RKAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+RKAdditions.m"; sourceTree = "<group>"; };
25160DAC145650490060A5C5 /* NSURL+RKAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+RKAdditions.h"; sourceTree = "<group>"; };
25160DAD145650490060A5C5 /* NSURL+RKAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+RKAdditions.m"; sourceTree = "<group>"; };
25160DB0145650490060A5C5 /* RKJSONParserJSONKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKJSONParserJSONKit.h; sourceTree = "<group>"; };
25160DB1145650490060A5C5 /* RKJSONParserJSONKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKJSONParserJSONKit.m; sourceTree = "<group>"; };
25160DBB145650490060A5C5 /* RestKit-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RestKit-Prefix.pch"; sourceTree = "<group>"; };
25160DBE145650490060A5C5 /* RKDotNetDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKDotNetDateFormatter.h; sourceTree = "<group>"; };
25160DBF145650490060A5C5 /* RKDotNetDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKDotNetDateFormatter.m; sourceTree = "<group>"; };
@@ -754,7 +748,7 @@
25160DC2145650490060A5C5 /* RKLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKLog.m; sourceTree = "<group>"; };
25160DC3145650490060A5C5 /* RKMIMETypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKMIMETypes.h; sourceTree = "<group>"; };
25160DC4145650490060A5C5 /* RKMIMETypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKMIMETypes.m; sourceTree = "<group>"; };
25160DC5145650490060A5C5 /* RKParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKParser.h; sourceTree = "<group>"; };
25160DC5145650490060A5C5 /* RKSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKSerialization.h; sourceTree = "<group>"; };
25160DC6145650490060A5C5 /* RKPathMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKPathMatcher.h; sourceTree = "<group>"; };
25160DC7145650490060A5C5 /* RKPathMatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKPathMatcher.m; sourceTree = "<group>"; };
25160DCA145650490060A5C5 /* RKSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKSupport.h; sourceTree = "<group>"; };
@@ -899,8 +893,8 @@
252EFB2114D9B35D004863C8 /* RKTestFixture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RKTestFixture.m; path = Testing/RKTestFixture.m; sourceTree = "<group>"; };
252EFB2414D9B6F2004863C8 /* RKTesting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RKTesting.h; path = Testing/RKTesting.h; sourceTree = "<group>"; };
252EFB2714DA0689004863C8 /* NakedEvents.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = NakedEvents.json; sourceTree = "<group>"; };
254372A615F54995006E8424 /* RKObjectParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKObjectParameters.h; sourceTree = "<group>"; };
254372A715F54995006E8424 /* RKObjectParameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKObjectParameters.m; sourceTree = "<group>"; };
254372A615F54995006E8424 /* RKObjectParameterization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKObjectParameterization.h; sourceTree = "<group>"; };
254372A715F54995006E8424 /* RKObjectParameterization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKObjectParameterization.m; sourceTree = "<group>"; };
254372AA15F54C3F006E8424 /* RKHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKHTTPRequestOperation.h; sourceTree = "<group>"; };
254372AB15F54C3F006E8424 /* RKHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKHTTPRequestOperation.m; sourceTree = "<group>"; };
254372AC15F54C3F006E8424 /* RKObjectManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKObjectManager.h; sourceTree = "<group>"; };
@@ -1301,8 +1295,8 @@
254372B515F54C3F006E8424 /* RKResponseDescriptor.m */,
254372B615F54C3F006E8424 /* RKResponseMapperOperation.h */,
254372B715F54C3F006E8424 /* RKResponseMapperOperation.m */,
254372A615F54995006E8424 /* RKObjectParameters.h */,
254372A715F54995006E8424 /* RKObjectParameters.m */,
254372A615F54995006E8424 /* RKObjectParameterization.h */,
254372A715F54995006E8424 /* RKObjectParameterization.m */,
25160D59145650490060A5C5 /* RKNetwork.h */,
252028FA1577AE0B00076FB4 /* RKRouteSet.h */,
252028FB1577AE0B00076FB4 /* RKRouteSet.m */,
@@ -1344,8 +1338,8 @@
25160D97145650490060A5C5 /* RKPropertyInspector.m */,
25160D98145650490060A5C5 /* RKRelationshipMapping.h */,
25160D99145650490060A5C5 /* RKRelationshipMapping.m */,
25160D9E145650490060A5C5 /* RKParserRegistry.h */,
25160D9F145650490060A5C5 /* RKParserRegistry.m */,
25160D9E145650490060A5C5 /* RKMIMETypeSerialization.h */,
25160D9F145650490060A5C5 /* RKMIMETypeSerialization.m */,
25CA7A8E14EC570100888FF8 /* RKMapping.m */,
258EA4A615A38BBF007E07A6 /* RKObjectMappingOperationDataSource.h */,
258EA4A715A38BBF007E07A6 /* RKObjectMappingOperationDataSource.m */,
@@ -1371,7 +1365,6 @@
25160DAB145650490060A5C5 /* NSString+RKAdditions.m */,
25160DAC145650490060A5C5 /* NSURL+RKAdditions.h */,
25160DAD145650490060A5C5 /* NSURL+RKAdditions.m */,
25160DAE145650490060A5C5 /* Parsers */,
25160DBB145650490060A5C5 /* RestKit-Prefix.pch */,
25160DBE145650490060A5C5 /* RKDotNetDateFormatter.h */,
25160DBF145650490060A5C5 /* RKDotNetDateFormatter.m */,
@@ -1381,7 +1374,7 @@
25160DC2145650490060A5C5 /* RKLog.m */,
25160DC3145650490060A5C5 /* RKMIMETypes.h */,
25160DC4145650490060A5C5 /* RKMIMETypes.m */,
25160DC5145650490060A5C5 /* RKParser.h */,
25160DC5145650490060A5C5 /* RKSerialization.h */,
25160DC6145650490060A5C5 /* RKPathMatcher.h */,
25160DC7145650490060A5C5 /* RKPathMatcher.m */,
25160DCA145650490060A5C5 /* RKSupport.h */,
@@ -1400,23 +1393,6 @@
path = Support;
sourceTree = "<group>";
};
25160DAE145650490060A5C5 /* Parsers */ = {
isa = PBXGroup;
children = (
25160DAF145650490060A5C5 /* JSON */,
);
path = Parsers;
sourceTree = "<group>";
};
25160DAF145650490060A5C5 /* JSON */ = {
isa = PBXGroup;
children = (
25160DB0145650490060A5C5 /* RKJSONParserJSONKit.h */,
25160DB1145650490060A5C5 /* RKJSONParserJSONKit.m */,
);
path = JSON;
sourceTree = "<group>";
};
25160E65145651060060A5C5 /* Other Frameworks */ = {
isa = PBXGroup;
children = (
@@ -1952,19 +1928,18 @@
25160E21145650490060A5C5 /* RKMappingResult.h in Headers */,
25160E23145650490060A5C5 /* RKPropertyInspector.h in Headers */,
25160E25145650490060A5C5 /* RKRelationshipMapping.h in Headers */,
25160E2B145650490060A5C5 /* RKParserRegistry.h in Headers */,
25160E2B145650490060A5C5 /* RKMIMETypeSerialization.h in Headers */,
25160E31145650490060A5C5 /* lcl_config_components.h in Headers */,
25160E32145650490060A5C5 /* lcl_config_extensions.h in Headers */,
25160E33145650490060A5C5 /* lcl_config_logger.h in Headers */,
25160E34145650490060A5C5 /* NSDictionary+RKAdditions.h in Headers */,
25160E36145650490060A5C5 /* NSString+RKAdditions.h in Headers */,
25160E38145650490060A5C5 /* NSURL+RKAdditions.h in Headers */,
25160E3A145650490060A5C5 /* RKJSONParserJSONKit.h in Headers */,
25160E44145650490060A5C5 /* RestKit-Prefix.pch in Headers */,
25160E47145650490060A5C5 /* RKDotNetDateFormatter.h in Headers */,
25160E4A145650490060A5C5 /* RKLog.h in Headers */,
25160E4C145650490060A5C5 /* RKMIMETypes.h in Headers */,
25160E4E145650490060A5C5 /* RKParser.h in Headers */,
25160E4E145650490060A5C5 /* RKSerialization.h in Headers */,
25160E4F145650490060A5C5 /* RKPathMatcher.h in Headers */,
25160E53145650490060A5C5 /* RKSupport.h in Headers */,
25160EDD1456532C0060A5C5 /* JSONKit.h in Headers */,
@@ -2027,7 +2002,7 @@
25BCB34F15ED57D500EE84DD /* AFXMLRequestOperation.h in Headers */,
25BCB35315ED57D500EE84DD /* UIImageView+AFNetworking.h in Headers */,
2557AD4315EE6A780027E9F1 /* NSMutableDictionary+RKAdditions.h in Headers */,
254372A815F54995006E8424 /* RKObjectParameters.h in Headers */,
254372A815F54995006E8424 /* RKObjectParameterization.h in Headers */,
254372B815F54C3F006E8424 /* RKHTTPRequestOperation.h in Headers */,
254372BC15F54C3F006E8424 /* RKObjectManager.h in Headers */,
254372C015F54C3F006E8424 /* RKObjectPaginator.h in Headers */,
@@ -2063,7 +2038,7 @@
25160F5C145655C60060A5C5 /* RKMappingResult.h in Headers */,
25160F5E145655C60060A5C5 /* RKPropertyInspector.h in Headers */,
25160F60145655C60060A5C5 /* RKRelationshipMapping.h in Headers */,
25160F66145655C60060A5C5 /* RKParserRegistry.h in Headers */,
25160F66145655C60060A5C5 /* RKMIMETypeSerialization.h in Headers */,
25160F69145655D10060A5C5 /* RKCoreData.h in Headers */,
25160F6F145655D10060A5C5 /* RKEntityMapping.h in Headers */,
25160F73145655D10060A5C5 /* RKManagedObjectImporter.h in Headers */,
@@ -2080,10 +2055,9 @@
25160F901456576C0060A5C5 /* RKDotNetDateFormatter.h in Headers */,
25160F931456576C0060A5C5 /* RKLog.h in Headers */,
25160F951456576C0060A5C5 /* RKMIMETypes.h in Headers */,
25160F971456576C0060A5C5 /* RKParser.h in Headers */,
25160F971456576C0060A5C5 /* RKSerialization.h in Headers */,
25160F981456576C0060A5C5 /* RKPathMatcher.h in Headers */,
25160F9C1456576C0060A5C5 /* RKSupport.h in Headers */,
25160F9E1456577F0060A5C5 /* RKJSONParserJSONKit.h in Headers */,
25160F25145655AF0060A5C5 /* RestKit.h in Headers */,
25B408271491CDDC00F21111 /* RKDirectoryUtilities.h in Headers */,
49D2759E14C9EF1E0090845D /* ISO8601DateFormatter.h in Headers */,
@@ -2460,11 +2434,10 @@
25160E22145650490060A5C5 /* RKMappingResult.m in Sources */,
25160E24145650490060A5C5 /* RKPropertyInspector.m in Sources */,
25160E26145650490060A5C5 /* RKRelationshipMapping.m in Sources */,
25160E2C145650490060A5C5 /* RKParserRegistry.m in Sources */,
25160E2C145650490060A5C5 /* RKMIMETypeSerialization.m in Sources */,
25160E35145650490060A5C5 /* NSDictionary+RKAdditions.m in Sources */,
25160E37145650490060A5C5 /* NSString+RKAdditions.m in Sources */,
25160E39145650490060A5C5 /* NSURL+RKAdditions.m in Sources */,
25160E3B145650490060A5C5 /* RKJSONParserJSONKit.m in Sources */,
25160E48145650490060A5C5 /* RKDotNetDateFormatter.m in Sources */,
25160E4B145650490060A5C5 /* RKLog.m in Sources */,
25160E4D145650490060A5C5 /* RKMIMETypes.m in Sources */,
@@ -2520,7 +2493,7 @@
25BCB35115ED57D500EE84DD /* AFXMLRequestOperation.m in Sources */,
25BCB35515ED57D500EE84DD /* UIImageView+AFNetworking.m in Sources */,
2557AD4515EE6A780027E9F1 /* NSMutableDictionary+RKAdditions.m in Sources */,
254372A915F54995006E8424 /* RKObjectParameters.m in Sources */,
254372A915F54995006E8424 /* RKObjectParameterization.m in Sources */,
254372BA15F54C3F006E8424 /* RKHTTPRequestOperation.m in Sources */,
254372BE15F54C3F006E8424 /* RKObjectManager.m in Sources */,
254372C215F54C3F006E8424 /* RKObjectPaginator.m in Sources */,
@@ -2626,7 +2599,7 @@
25160F5D145655C60060A5C5 /* RKMappingResult.m in Sources */,
25160F5F145655C60060A5C5 /* RKPropertyInspector.m in Sources */,
25160F61145655C60060A5C5 /* RKRelationshipMapping.m in Sources */,
25160F67145655C60060A5C5 /* RKParserRegistry.m in Sources */,
25160F67145655C60060A5C5 /* RKMIMETypeSerialization.m in Sources */,
25160F70145655D10060A5C5 /* RKEntityMapping.m in Sources */,
25160F74145655D10060A5C5 /* RKManagedObjectImporter.m in Sources */,
25160F76145655D10060A5C5 /* RKManagedObjectStore.m in Sources */,
@@ -2640,7 +2613,6 @@
25160F941456576C0060A5C5 /* RKLog.m in Sources */,
25160F961456576C0060A5C5 /* RKMIMETypes.m in Sources */,
25160F991456576C0060A5C5 /* RKPathMatcher.m in Sources */,
25160F9F1456577F0060A5C5 /* RKJSONParserJSONKit.m in Sources */,
25B408291491CDDC00F21111 /* RKDirectoryUtilities.m in Sources */,
49D275A114C9EF1E0090845D /* ISO8601DateFormatter.m in Sources */,
49D275B014C9F3020090845D /* RKISO8601DateFormatter.m in Sources */,

View File

@@ -98,7 +98,7 @@
[mapping mapAttributes:@"boolString", nil];
TestMappable *object = [[[TestMappable alloc] init] autorelease];
id<RKParser> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id<RKSerialization> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id data = [parser objectFromString:@"{\"boolString\":true}" error:nil];
RKMappingOperation *operation = [[RKMappingOperation alloc] initWithSourceObject:data destinationObject:object mapping:mapping];
@@ -114,7 +114,7 @@
[mapping mapAttributes:@"boolNumber", nil];
TestMappable *object = [[[TestMappable alloc] init] autorelease];
id<RKParser> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id<RKSerialization> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id data = [parser objectFromString:@"{\"boolNumber\":true}" error:nil];
RKMappingOperation *operation = [[RKMappingOperation alloc] initWithSourceObject:data destinationObject:object mapping:mapping];
@@ -130,7 +130,7 @@
[mapping mapAttributes:@"boolNumber", nil];
TestMappable *object = [[[TestMappable alloc] init] autorelease];
id<RKParser> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id<RKSerialization> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id data = [parser objectFromString:@"{\"boolNumber\":false}" error:nil];
RKMappingOperation *operation = [[RKMappingOperation alloc] initWithSourceObject:data destinationObject:object mapping:mapping];
@@ -146,7 +146,7 @@
[mapping mapKeyPath:@"number" toAttribute:@"boolString"];
TestMappable *object = [[[TestMappable alloc] init] autorelease];
id<RKParser> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id<RKSerialization> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id data = [parser objectFromString:@"{\"number\":123}" error:nil];
RKMappingOperation *operation = [[RKMappingOperation alloc] initWithSourceObject:data destinationObject:object mapping:mapping];
@@ -162,7 +162,7 @@
[mapping mapKeyPath:@"numbers" toAttribute:@"orderedSet"];
TestMappable *object = [[[TestMappable alloc] init] autorelease];
id<RKParser> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id<RKSerialization> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:@"application/json"];
id data = [parser objectFromString:@"{\"numbers\":[1, 2, 3]}" error:nil];
RKMappingOperation *operation = [[RKMappingOperation alloc] initWithSourceObject:data destinationObject:object mapping:mapping];

View File

@@ -42,7 +42,7 @@
{
RKParserRegistry *registry = [[RKParserRegistry new] autorelease];
[registry setParserClass:[RKJSONParserJSONKit class] forMIMEType:RKMIMETypeJSON];
id<RKParser> parser = [registry parserForMIMEType:RKMIMETypeJSON];
id<RKSerialization> parser = [registry parserForMIMEType:RKMIMETypeJSON];
assertThat(parser, is(instanceOf([RKJSONParserJSONKit class])));
}
@@ -50,7 +50,7 @@
{
RKParserRegistry *registry = [[RKParserRegistry new] autorelease];
[registry autoconfigure];
id<RKParser> parser = [registry parserForMIMEType:RKMIMETypeJSON];
id<RKSerialization> parser = [registry parserForMIMEType:RKMIMETypeJSON];
assertThat(parser, is(instanceOf([RKJSONParserJSONKit class])));
parser = [registry parserForMIMEType:RKMIMETypeXML];
assertThat(parser, is(instanceOf([RKXMLParserXMLReader class])));
@@ -60,7 +60,7 @@
{
RKParserRegistry *registry = [[RKParserRegistry new] autorelease];
[registry setParserClass:[RKJSONParserJSONKit class] forMIMEType:RKMIMETypeJSON];
id<RKParser> parser = [registry parserForMIMEType:RKMIMETypeJSON];
id<RKSerialization> parser = [registry parserForMIMEType:RKMIMETypeJSON];
assertThat(parser, is(instanceOf([RKJSONParserJSONKit class])));
}
@@ -70,7 +70,7 @@
NSError *error = nil;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"application/xml\\+\\w+" options:0 error:&error];
[registry setParserClass:[RKJSONParserJSONKit class] forMIMETypeRegularExpression:regex];
id<RKParser> parser = [registry parserForMIMEType:@"application/xml+whatever"];
id<RKSerialization> parser = [registry parserForMIMEType:@"application/xml+whatever"];
assertThat(parser, is(instanceOf([RKJSONParserJSONKit class])));
}
@@ -83,11 +83,11 @@
[registry setParserClass:[RKXMLParserXMLReader class] forMIMEType:@"application/xml+whatever"];
// Exact match
id<RKParser> exactParser = [registry parserForMIMEType:@"application/xml+whatever"];
id<RKSerialization> exactParser = [registry parserForMIMEType:@"application/xml+whatever"];
assertThat(exactParser, is(instanceOf([RKXMLParserXMLReader class])));
// Fallback to regex
id<RKParser> regexParser = [registry parserForMIMEType:@"application/xml+different"];
id<RKSerialization> regexParser = [registry parserForMIMEType:@"application/xml+different"];
assertThat(regexParser, is(instanceOf([RKJSONParserJSONKit class])));
}