Showing preview only (233K chars total). Download the full file or copy to clipboard to get everything.
Repository: dchohfi/KeyValueObjectMapping
Branch: master
Commit: 93d0f25e8a31
Files: 91
Total size: 210.4 KB
Directory structure:
gitextract_xqg0idnf/
├── .gitignore
├── DCKeyValueObjectMapping.podspec
├── KeyValueObjectMapping/
│ ├── DCArrayMapping.h
│ ├── DCArrayMapping.m
│ ├── DCAttributeSetter.h
│ ├── DCAttributeSetter.m
│ ├── DCCustomInitialize.h
│ ├── DCCustomInitialize.m
│ ├── DCCustomParser.h
│ ├── DCCustomParser.m
│ ├── DCDictionaryRearranger.h
│ ├── DCDictionaryRearranger.m
│ ├── DCDynamicAttribute.h
│ ├── DCDynamicAttribute.m
│ ├── DCGenericConverter.h
│ ├── DCGenericConverter.m
│ ├── DCKeyValueObjectMapping.h
│ ├── DCKeyValueObjectMapping.m
│ ├── DCMapping.h
│ ├── DCNSArrayConverter.h
│ ├── DCNSArrayConverter.m
│ ├── DCNSDateConverter.h
│ ├── DCNSDateConverter.m
│ ├── DCNSSetConverter.h
│ ├── DCNSSetConverter.m
│ ├── DCNSURLConverter.h
│ ├── DCNSURLConverter.m
│ ├── DCObjectMapping.h
│ ├── DCObjectMapping.m
│ ├── DCParserConfiguration.h
│ ├── DCParserConfiguration.m
│ ├── DCPropertyAggregator.h
│ ├── DCPropertyAggregator.m
│ ├── DCPropertyFinder.h
│ ├── DCPropertyFinder.m
│ ├── DCReferenceKeyParser.h
│ ├── DCReferenceKeyParser.m
│ ├── DCSimpleConverter.h
│ ├── DCSimpleConverter.m
│ ├── DCValueConverter.h
│ ├── KeyValueObjectMapping-Info.plist
│ ├── KeyValueObjectMapping-Prefix.pch
│ ├── NSObject+DCKeyValueObjectMapping.h
│ └── NSObject+DCKeyValueObjectMapping.m
├── KeyValueObjectMapping.xcodeproj/
│ ├── project.pbxproj
│ └── xcshareddata/
│ └── xcschemes/
│ ├── KeyValueObjectMapping.xcscheme
│ └── KeyValueObjectMappingTests.xcscheme
├── KeyValueObjectMappingTests/
│ ├── Bus.h
│ ├── Bus.m
│ ├── DCArrayOfTweetsOnUserTests.h
│ ├── DCArrayOfTweetsOnUserTests.m
│ ├── DCCoverageFix.h
│ ├── DCCoverageFix.m
│ ├── DCCustomFormaterTests.h
│ ├── DCCustomFormaterTests.m
│ ├── DCCustomInitializeTest.h
│ ├── DCCustomInitializeTest.m
│ ├── DCCustomParserTests.h
│ ├── DCCustomParserTests.m
│ ├── DCDynamicAttributeTest.h
│ ├── DCDynamicAttributeTest.m
│ ├── DCNSDateConverterTests.h
│ ├── DCNSDateConverterTests.m
│ ├── DCParserConfigurationTest.h
│ ├── DCParserConfigurationTest.m
│ ├── DCPropertyAggregatorTests.h
│ ├── DCPropertyAggregatorTests.m
│ ├── DCPropertyFinderTests.h
│ ├── DCPropertyFinderTests.m
│ ├── DCReferenceKeyParserTests.h
│ ├── DCReferenceKeyParserTests.m
│ ├── DCSerializationTests.h
│ ├── DCSerializationTests.m
│ ├── KeyValueObjectMappingTests-Info.plist
│ ├── KeyValueObjectMappingTests.h
│ ├── KeyValueObjectMappingTests.m
│ ├── Location.h
│ ├── Location.m
│ ├── NSObject+DCKeyValueObjectMappingTests.m
│ ├── Person.h
│ ├── Person.m
│ ├── Tweet.h
│ ├── Tweet.m
│ ├── User.h
│ ├── User.m
│ ├── en.lproj/
│ │ └── InfoPlist.strings
│ ├── plist.plist
│ ├── tweet.json
│ └── user.json
├── LICENSE
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea
================================================
FILE: DCKeyValueObjectMapping.podspec
================================================
Pod::Spec.new do |s|
s.name = "DCKeyValueObjectMapping"
s.version = "1.5"
s.summary = "Automatic KeyValue Object Mapping for Objective-C, parse JSON/plist/Dictionary automatically"
s.homepage = "https://github.com/dchohfi/KeyValueObjectMapping"
s.authors = { 'Diego Chohfi' => 'dchohfi@gmail.com' }
s.license = 'MIT'
s.source = { :git => "https://github.com/dchohfi/KeyValueObjectMapping.git", :tag => "1.5" }
s.ios.deployment_target = '5.0'
s.osx.deployment_target = '10.7'
s.source_files = 'KeyValueObjectMapping/**/*.{h,m}'
s.requires_arc = true
end
================================================
FILE: KeyValueObjectMapping/DCArrayMapping.h
================================================
//
// DCArrayMapping.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/16/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCObjectMapping.h"
@interface DCArrayMapping : NSObject <DCMapping>
@property(nonatomic, readonly) DCObjectMapping *objectMapping;
@property(nonatomic, readonly) Class classForElementsOnArray;
+ (DCArrayMapping *) mapperForClassElements: (Class) classForElementsOnArray
forAttribute: (NSString *) attribute
onClass: (Class) classReference;
+ (DCArrayMapping *) mapperForClass: (Class) classForElementsOnArray
onMapping: (DCObjectMapping *) objectMapping;
@end
================================================
FILE: KeyValueObjectMapping/DCArrayMapping.m
================================================
//
// DCArrayMapping.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/16/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCArrayMapping.h"
@implementation DCArrayMapping
@synthesize objectMapping = _objectMapping;
@synthesize classForElementsOnArray = _classForElementsOnArray;
+ (DCArrayMapping *) mapperForClassElements: (Class) classForElementsOnArray
forAttribute: (NSString *) attribute
onClass: (Class) classReference{
DCObjectMapping *objectMapping = [DCObjectMapping mapKeyPath:attribute
toAttribute:attribute
onClass:classReference];
return [[self alloc] initWithObjectMapping:objectMapping
forArrayElementOfType:classForElementsOnArray];
}
+ (DCArrayMapping *) mapperForClass: (Class) classForElementsOnArray
onMapping: (DCObjectMapping *) objectMapping {
return [[self alloc] initWithObjectMapping:objectMapping
forArrayElementOfType:classForElementsOnArray];
}
- (id)initWithObjectMapping: (DCObjectMapping *) objectMapping
forArrayElementOfType: (Class) classForElementsOnArray {
self = [super init];
if (self) {
_objectMapping = objectMapping;
_classForElementsOnArray = classForElementsOnArray;
}
return self;
}
@end
================================================
FILE: KeyValueObjectMapping/DCAttributeSetter.h
================================================
//
// DCAttributeSetter.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DCAttributeSetter : NSObject
+ (void)assingValue: (id)value
forAttributeName: (NSString *)attributeName
andAttributeClass: (Class) attributeClass
onObject:(id)object;
@end
================================================
FILE: KeyValueObjectMapping/DCAttributeSetter.m
================================================
//
// DCAttributeSetter.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCAttributeSetter.h"
@implementation DCAttributeSetter
+ (void)assingValue:(id)value forAttributeName: (NSString *)attributeName andAttributeClass: (Class) attributeClass onObject:(id)object {
if ([value isKindOfClass:[NSNull class]]) {
value = nil;
}
if([object validateValue:&value forKey:attributeName error:nil]){
if(([value isKindOfClass:[NSNull class]] || value == nil) && attributeClass == [NSString class]){
[object setValue:nil forKey:attributeName];
}else {
@try {
[object setValue:value forKey:attributeName];
}
@catch (NSException *e) {
[object setValue:@(0) forKey:attributeName];
}
}
}
}
@end
================================================
FILE: KeyValueObjectMapping/DCCustomInitialize.h
================================================
//
// DCCustomInitialize.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 8/21/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef id(^DCCustomInitializeBlock)(__weak Class classOfObjectToGenerate, __weak NSDictionary *values, __weak id parentObject);
@interface DCCustomInitialize : NSObject
@property(nonatomic, readonly) DCCustomInitializeBlock blockInitialize;
@property(nonatomic, readonly) Class classOfObjectToGenerate;
- (id) initWithBlockInitialize: (DCCustomInitializeBlock) blockInitialize
forClass: (Class) classOfObjectToGenerate;
- (BOOL) isValidToPerformBlock: (Class) classOfObjectToGenerate;
@end
================================================
FILE: KeyValueObjectMapping/DCCustomInitialize.m
================================================
//
// DCCustomInitialize.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 8/21/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCCustomInitialize.h"
@implementation DCCustomInitialize
@synthesize blockInitialize = _blockInitialize;
@synthesize classOfObjectToGenerate = _classOfObjectToGenerate;
- (id) initWithBlockInitialize: (DCCustomInitializeBlock) blockInitialize
forClass: (Class) classOfObjectToGenerate {
self = [super init];
if (self) {
_blockInitialize = [blockInitialize copy];
_classOfObjectToGenerate = classOfObjectToGenerate;
}
return self;
}
- (BOOL) isValidToPerformBlock: (Class) classOfObjectToGenerate {
return _classOfObjectToGenerate == classOfObjectToGenerate;
}
@end
================================================
FILE: KeyValueObjectMapping/DCCustomParser.h
================================================
//
// DCCustomParser.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 9/3/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef id(^DCCustomParserBlock)(__weak NSDictionary *dictionary, __weak NSString *attributeName, __weak Class destinationClass, __weak id value);
@interface DCCustomParser : NSObject
@property(nonatomic, readonly) NSString *attributeName;
@property(nonatomic, readonly) Class destinationClass;
@property(nonatomic, readonly) DCCustomParserBlock blockParser;
- (id) initWithBlockParser: (DCCustomParserBlock) blockParser
forAttributeName: (NSString *) attributeName
onDestinationClass: (Class) classe;
- (BOOL) isValidToPerformBlockOnAttributeName: (NSString *) attributeName
forClass: (Class) classe;
@end
================================================
FILE: KeyValueObjectMapping/DCCustomParser.m
================================================
//
// DCCustomParser.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 9/3/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCCustomParser.h"
@implementation DCCustomParser
@synthesize blockParser = _blockParser;
@synthesize attributeName = _attributeName;
@synthesize destinationClass = _destinationClass;
- (id) initWithBlockParser: (DCCustomParserBlock) blockParser
forAttributeName: (NSString *) attributeName
onDestinationClass: (Class) classe {
self = [super init];
if(self){
_attributeName = attributeName;
_destinationClass = classe;
_blockParser = [blockParser copy];
}
return self;
}
- (BOOL) isValidToPerformBlockOnAttributeName: (NSString *) attributeName
forClass: (Class) classe {
return [_attributeName isEqualToString:attributeName] && classe == _destinationClass;
}
@end
================================================
FILE: KeyValueObjectMapping/DCDictionaryRearranger.h
================================================
//
// DCDictionaryRearranger.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCParserConfiguration.h"
@interface DCDictionaryRearranger : NSObject
+ (NSDictionary *) rearrangeDictionary: (NSDictionary *) dictionary forConfiguration: (DCParserConfiguration *) configuration;
@end
================================================
FILE: KeyValueObjectMapping/DCDictionaryRearranger.m
================================================
//
// DCDictionaryRearranger.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCDictionaryRearranger.h"
#import "DCObjectMapping.h"
#import "DCPropertyAggregator.h"
@implementation DCDictionaryRearranger
+ (NSDictionary *) rearrangeDictionary: (NSDictionary *) dictionary forConfiguration: (DCParserConfiguration *) configuration {
NSMutableArray* aggregators = [NSMutableArray arrayWithArray:[[configuration.aggregators reverseObjectEnumerator] allObjects]];
NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionaryWithDictionary:dictionary];
if(aggregators && [aggregators count] > 0){
for(NSInteger i=[aggregators count] - 1; i >= 0; --i){
DCPropertyAggregator* aggregator = [aggregators objectAtIndex:i];
[aggregators removeObject:aggregator];
NSMutableDictionary *aggregatedValues = [[aggregator aggregateKeysOnDictionary:mutableDictionary] mutableCopy];
if([mutableDictionary objectForKey:aggregator.attribute]){
[aggregatedValues addEntriesFromDictionary:[mutableDictionary objectForKey:aggregator.attribute]];
}
[mutableDictionary setValue:aggregatedValues forKey:aggregator.attribute];
}
}
for (DCObjectMapping* mapper in configuration.objectMappers) {
NSArray* keys = [mapper.keyReference componentsSeparatedByString:configuration.nestedPrepertiesSplitToken];
// Composed key
id value;
if (keys.count >1) {
for (NSString* key in keys) {
if ([key isEqualToString:keys[0]]) {
value = [mutableDictionary objectForKey:key];
} else if ([value isKindOfClass:[NSDictionary class]]) {
NSDictionary* dict = (NSDictionary*)value;
value = [dict objectForKey:key];
if ([key isEqualToString:[keys lastObject]]) {
[mutableDictionary setValue:value forKey:mapper.keyReference];
}
}
}
}
}
return [NSDictionary dictionaryWithDictionary:mutableDictionary];
}
@end
================================================
FILE: KeyValueObjectMapping/DCDynamicAttribute.h
================================================
//
// DCDynamicAttribute.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/14/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCObjectMapping.h"
#import "DCValueConverter.h"
@interface DCDynamicAttribute : NSObject
@property(nonatomic, readonly) DCObjectMapping *objectMapping;
@property(nonatomic, readonly) NSString *typeName;
@property(nonatomic, readonly) Class classe;
@property(nonatomic, readonly, getter = isPrimitive) BOOL primitive;
@property(nonatomic, readonly, getter = isIdType) BOOL idType;
@property(nonatomic, readonly, getter = isValidObject) BOOL validObject;
- (id)initWithClass: (Class) classs;
- (id)initWithAttributeDescription: (NSString *) description
forKey: (NSString *) key
onClass: (Class) classe;
- (id)initWithAttributeDescription: (NSString *) description
forKey: (NSString *) key
onClass: (Class) classe
attributeName: (NSString *) attibuteName;
- (id)initWithAttributeDescription: (NSString *) description
forKey: (NSString *) key
onClass: (Class) classe
attributeName: (NSString *) attibuteName
converter:(id<DCValueConverter>) converter;
@end
================================================
FILE: KeyValueObjectMapping/DCDynamicAttribute.m
================================================
//
// DCDynamicAttribute.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/14/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCDynamicAttribute.h"
@interface DCDynamicAttribute()
- (NSString *) findTypeInformation: (NSString *) typeInformation;
- (NSString *) findTypeName: (NSString *) name;
@end
@implementation DCDynamicAttribute
@synthesize primitive = _primitive;
@synthesize idType = _idType;
@synthesize validObject = _validObject;
@synthesize objectMapping = _objectMapping;
@synthesize typeName = _typeName;
@synthesize classe = _classe;
- (id)initWithClass: (Class) classs {
self = [super init];
if (self) {
_objectMapping = [[DCObjectMapping alloc] initWithClass:classs];
_validObject = YES;
}
return self;
}
- (id)initWithAttributeDescription: (NSString *) description
forKey: (NSString *) key
onClass: (Class) classe {
return [self initWithAttributeDescription:description
forKey:key
onClass:classe
attributeName:nil];
}
- (id)initWithAttributeDescription: (NSString *) description
forKey: (NSString *) key
onClass: (Class) classe
attributeName: (NSString *) attibuteName {
return [self initWithAttributeDescription:description
forKey:key
onClass:classe
attributeName:attibuteName
converter:nil];
}
- (id)initWithAttributeDescription: (NSString *) description
forKey: (NSString *) key
onClass: (Class) classe
attributeName: (NSString *) attibuteName
converter: (id <DCValueConverter>)converter {
self = [super init];
if (self) {
_classe = classe;
NSArray *splitedDescription = [description componentsSeparatedByString:@","];
NSString *attributeName = [self findTypeName: [splitedDescription lastObject]];
if (attributeName.length == 0 && attibuteName.length){
attributeName = attibuteName;
}
_typeName = [self findTypeInformation:[splitedDescription objectAtIndex:0]];
Class attributeClass = NSClassFromString(self.typeName);
_objectMapping = [DCObjectMapping mapKeyPath:key toAttribute:attributeName onClass:attributeClass converter:converter];
}
return self;
}
- (NSString *) findTypeInformation: (NSString *) typeInformation {
NSString *attrituteClass = nil;
BOOL isType = [[typeInformation substringToIndex:1] isEqualToString:@"T"];
BOOL isAnObject = [[typeInformation substringWithRange:NSMakeRange(1, 1)] isEqualToString:@"@"];
if(isType && !isAnObject){
_primitive = YES;
attrituteClass = [typeInformation substringWithRange:NSMakeRange(1, 1)];
}else if ([typeInformation length] == 2) {
_idType = YES;
} else {
_validObject = YES;
attrituteClass = [typeInformation substringWithRange:NSMakeRange(3, [typeInformation length] - 4)];
}
return attrituteClass;
}
- (NSString *) findTypeName: (NSString *) name {
return [name substringFromIndex:1];
}
@end
================================================
FILE: KeyValueObjectMapping/DCGenericConverter.h
================================================
//
// DCGenericConverter.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCDynamicAttribute.h"
#import "DCParserConfiguration.h"
@interface DCGenericConverter : NSObject
- (id)initWithConfiguration:(DCParserConfiguration *) configuration;
- (id)transformValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject;
- (id)serializeValue:(id)value forDynamicAttribute: (DCDynamicAttribute *) attribute;
@end
================================================
FILE: KeyValueObjectMapping/DCGenericConverter.m
================================================
//
// DCGenericConverter.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCGenericConverter.h"
#import "DCNSDateConverter.h"
#import "DCNSURLConverter.h"
#import "DCSimpleConverter.h"
#import "DCNSArrayConverter.h"
#import "DCNSSetConverter.h"
#import "DCCustomParser.h"
#import "DCKeyValueObjectMapping.h"
@interface DCGenericConverter()
@property(nonatomic, strong) DCParserConfiguration *configuration;
@property(nonatomic, strong) NSArray *parsers;
@end
@implementation DCGenericConverter
@synthesize configuration = _configuration;
@synthesize parsers = _parsers;
- (id)initWithConfiguration:(DCParserConfiguration *) configuration {
self = [super init];
if (self) {
_configuration = configuration;
_parsers = [NSArray arrayWithObjects:
[DCNSDateConverter dateConverterForPattern:self.configuration.datePattern],
[DCNSURLConverter urlConverter],
[DCNSArrayConverter arrayConverterForConfiguration: self.configuration],
[DCNSSetConverter setConverterForConfiguration: self.configuration], nil];
}
return self;
}
- (id)transformValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
if([attribute isValidObject]){
BOOL valueIsKindOfDictionary = [value isKindOfClass:[NSDictionary class]];
BOOL attributeNotKindOfDictionary = ![attribute.objectMapping.classReference isSubclassOfClass:[NSDictionary class]];
if (valueIsKindOfDictionary && attributeNotKindOfDictionary) {
id parsedValue = [self parseValueForBlock:value forObjectMapping:attribute dictionary:dictionary parentObject:parentObject];
if (parsedValue) {
return parsedValue;
}
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:attribute.objectMapping.classReference
andConfiguration:self.configuration];
value = [parser parseDictionary:(NSDictionary *) value forParentObject:parentObject];
}else {
id parsedValue = [self parseSimpleValue:value forDynamicAttribute:attribute dictionary:dictionary parentObject:parentObject];
if (parsedValue) return parsedValue;
}
}
DCSimpleConverter *simpleParser = [[DCSimpleConverter alloc] init];
return [simpleParser transformValue:value forDynamicAttribute:attribute dictionary:dictionary parentObject:parentObject];
}
- (id)serializeValue:(id)value forDynamicAttribute: (DCDynamicAttribute *) attribute {
for (id<DCValueConverter> parser in self.parsers) {
if([parser canTransformValueForClass:attribute.objectMapping.classReference]){
return [parser serializeValue:value forDynamicAttribute:attribute];
}
}
DCSimpleConverter *simpleParser = [[DCSimpleConverter alloc] init];
return [simpleParser serializeValue:value forDynamicAttribute:attribute];
}
#pragma mark - private methods
- (id)parseSimpleValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
id parsedValue = [self parseValueForBlock:value forObjectMapping:attribute dictionary:dictionary parentObject:parentObject];
if(parsedValue){
return parsedValue;
}
return [self parseValueForParsers:value forDynamicAttribute:attribute dictionary:dictionary parentObject:parentObject];
}
- (id)parseValueForParsers:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
for (id<DCValueConverter> parser in self.parsers) {
if([parser canTransformValueForClass:attribute.objectMapping.classReference]){
return [parser transformValue:value forDynamicAttribute:attribute dictionary:dictionary parentObject:parentObject];
}
}
return nil;
}
- (id)parseValueForBlock:(id)value forObjectMapping:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
DCObjectMapping *objectMapping = attribute.objectMapping;
for(DCCustomParser *parser in self.configuration.customParsers){
if ([parser isValidToPerformBlockOnAttributeName:objectMapping.attributeName
forClass:attribute.classe]) {
return parser.blockParser(dictionary, objectMapping.attributeName, attribute.classe, value);
}
}
return nil;
}
@end
================================================
FILE: KeyValueObjectMapping/DCKeyValueObjectMapping.h
================================================
//
// DCKeyValueObjectMapping.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
@class DCParserConfiguration;
@interface DCKeyValueObjectMapping : NSObject
@property(nonatomic, readonly) Class classToGenerate;
+ (DCKeyValueObjectMapping *) mapperForClass: (Class) classToGenerate;
+ (DCKeyValueObjectMapping *) mapperForClass: (Class) classToGenerate
andConfiguration: (DCParserConfiguration *) configuration;
- (id)initWithClass: (Class) classToGenerate
forConfiguration: (DCParserConfiguration *) configuration;
- (id)parseDictionary:(NSDictionary *)dictionary;
- (id)parseDictionary:(NSDictionary *)dictionary forParentObject:(id)parentObject;
- (NSArray *)parseArray:(NSArray *)array;
- (NSArray *)parseArray:(NSArray *)array forParentObject:(id)parentObject;
- (NSDictionary *)serializeObject:(id)object;
- (NSArray *)serializeObjectArray:(NSArray *)objectArray;
- (void)updateObject:(id)object withDictionary:(NSDictionary *)dictionary;
@end
================================================
FILE: KeyValueObjectMapping/DCKeyValueObjectMapping.m
================================================
//
// DCKeyValueObjectMapping.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCKeyValueObjectMapping.h"
#import "DCGenericConverter.h"
#import "DCDynamicAttribute.h"
#import "DCReferenceKeyParser.h"
#import "DCPropertyFinder.h"
#import "DCAttributeSetter.h"
#import "DCDictionaryRearranger.h"
@interface DCKeyValueObjectMapping()
@property(nonatomic, strong) DCGenericConverter *converter;
@property(nonatomic, strong) DCPropertyFinder *propertyFinder;
@property(nonatomic, strong) DCParserConfiguration *configuration;
@end
@implementation DCKeyValueObjectMapping
@synthesize converter = _converter;
@synthesize propertyFinder = _propertyFinder;
@synthesize configuration = _configuration;
@synthesize classToGenerate = _classToGenerate;
+ (DCKeyValueObjectMapping *) mapperForClass: (Class) classToGenerate {
return [self mapperForClass:classToGenerate andConfiguration:[DCParserConfiguration configuration]];
}
+ (DCKeyValueObjectMapping *) mapperForClass: (Class) classToGenerate andConfiguration: (DCParserConfiguration *) configuration {
return [[self alloc] initWithClass: classToGenerate
forConfiguration: configuration];
}
- (id) initWithClass: (Class) classToGenerate forConfiguration: (DCParserConfiguration *) configuration {
self = [super init];
if (self) {
self.configuration = configuration;
DCReferenceKeyParser *keyParser = [DCReferenceKeyParser parserForToken: self.configuration.splitToken];
self.propertyFinder = [DCPropertyFinder finderWithKeyParser:keyParser];
[self.propertyFinder setMappers:[configuration objectMappers]];
self.converter = [[DCGenericConverter alloc] initWithConfiguration:configuration];
_classToGenerate = classToGenerate;
}
return self;
}
- (NSArray *)parseArray:(NSArray *)array {
return [self parseArray:array forParentObject:nil];
}
- (NSArray *)parseArray:(NSArray *)array forParentObject:(id)parentObject {
if(!array){
return nil;
}
NSMutableArray *values = [[NSMutableArray alloc] initWithCapacity:[array count]];
for (id dictionary in array) {
if ([dictionary isKindOfClass:[NSNull class]]) {
continue;
}
id value = [self parseDictionary:dictionary forParentObject:parentObject];
[values addObject:value];
}
return [NSArray arrayWithArray:values];
}
- (id)parseDictionary:(NSDictionary *)dictionary {
return [self parseDictionary:dictionary forParentObject:nil];
}
- (id)parseDictionary:(NSDictionary *)dictionary forParentObject:(id)parentObject {
if (!dictionary || !self.classToGenerate) {
return nil;
}
NSObject *object = [[self configuration] instantiateObjectForClass:self.classToGenerate withValues:dictionary parentObject:parentObject];
[self setValuesOnObject:object withDictionary:dictionary];
return object;
}
- (void) setValuesOnObject: (id) object withDictionary: (NSDictionary *) dictionary {
if(![[object class] isSubclassOfClass:self.classToGenerate]){
return;
}
dictionary = [DCDictionaryRearranger rearrangeDictionary:dictionary
forConfiguration:self.configuration];
NSArray *keys = [dictionary allKeys];
for (NSString *key in keys) {
id value = [dictionary valueForKey:key];
DCDynamicAttribute *dynamicAttribute = [self.propertyFinder findAttributeForKey:key
onClass:self.classToGenerate];
if(dynamicAttribute){
[self parseValue:value forObject:object inAttribute:dynamicAttribute dictionary:dictionary];
}
}
}
- (NSDictionary *)serializeObject:(id)object
{
NSMutableDictionary *serializedObject = [[NSMutableDictionary alloc] init];
for (DCObjectMapping *mapping in self.propertyFinder.mappers) {
NSString * attributeName = mapping.attributeName;
id value = [object valueForKey:attributeName];
DCDynamicAttribute *dynamicAttribute = [self.propertyFinder findAttributeForKey:mapping.keyReference
onClass:self.classToGenerate];
if(dynamicAttribute){
[self serializeValue:value toDictionary:serializedObject
inAttribute:dynamicAttribute];
}
}
return [NSDictionary dictionaryWithDictionary:serializedObject];
}
- (NSArray *)serializeObjectArray:(NSArray *)objectArray
{
NSMutableArray *serializedObjects = [[NSMutableArray alloc] init];
for (id object in objectArray) {
[serializedObjects addObject:[self serializeObject:object]];
}
return [NSArray arrayWithArray:serializedObjects];
}
- (void) parseValue: (id) value
forObject: (id) object
inAttribute: (DCDynamicAttribute *) dynamicAttribute
dictionary: (NSDictionary *) dictionary {
DCObjectMapping *objectMapping = dynamicAttribute.objectMapping;
NSString *attributeName = objectMapping.attributeName;
if (objectMapping.converter) {
value = [objectMapping.converter transformValue:value forDynamicAttribute:dynamicAttribute dictionary:dictionary parentObject:object];
}
else {
value = [self.converter transformValue:value forDynamicAttribute:dynamicAttribute dictionary:dictionary parentObject:object];
}
[DCAttributeSetter assingValue:value
forAttributeName:attributeName
andAttributeClass:objectMapping.classReference
onObject:object];
}
- (void) serializeValue: (id) value toDictionary: (NSMutableDictionary *) dictionary inAttribute: (DCDynamicAttribute *) dynamicAttribute {
DCObjectMapping *objectMapping = dynamicAttribute.objectMapping;
if (objectMapping.converter)
value = [objectMapping.converter serializeValue:value forDynamicAttribute:dynamicAttribute];
else
value = [self.converter serializeValue:value forDynamicAttribute:dynamicAttribute];
[dictionary setValue:value forKeyPath:objectMapping.keyReference];
}
- (void)updateObject:(id)object withDictionary:(NSDictionary *)dictionary {
if (!dictionary || !self.classToGenerate || !object || ![object isKindOfClass:self.classToGenerate])
return;
[self setValuesOnObject:object withDictionary:dictionary];
return;
}
@end
================================================
FILE: KeyValueObjectMapping/DCMapping.h
================================================
//
// DCMapping.h
// KeyValueObjectMapping
//
// Created by moda on 5/19/15.
// Copyright (c) 2015 dchohfi. All rights reserved.
//
#ifndef KeyValueObjectMapping_DCMapping_h
#define KeyValueObjectMapping_DCMapping_h
@protocol DCMapping <NSObject>
// intentionally empty
@end
#endif
================================================
FILE: KeyValueObjectMapping/DCNSArrayConverter.h
================================================
//
// DCNSArrayConverter.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCValueConverter.h"
@interface DCNSArrayConverter : NSObject <DCValueConverter>
+ (DCNSArrayConverter *) arrayConverterForConfiguration: (DCParserConfiguration *)configuration;
@end
================================================
FILE: KeyValueObjectMapping/DCNSArrayConverter.m
================================================
//
// DCNSArrayConverter.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCNSArrayConverter.h"
#import "DCSimpleConverter.h"
#import "DCArrayMapping.h"
#import "DCKeyValueObjectMapping.h"
#import "DCDynamicAttribute.h"
#import "DCGenericConverter.h"
@interface DCNSArrayConverter()
@property(nonatomic, strong) DCParserConfiguration *configuration;
@end
@implementation DCNSArrayConverter
@synthesize configuration = _configuration;
+ (DCNSArrayConverter *) arrayConverterForConfiguration: (DCParserConfiguration *)configuration {
return [[self alloc] initWithConfiguration: configuration];
}
- (id)initWithConfiguration:(DCParserConfiguration *)configuration{
self = [super init];
if (self) {
_configuration = configuration;
}
return self;
}
- (id)transformValue:(id)values forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
if (!values || values == [NSNull null] || [values count] == 0) {
return nil;
}
BOOL primitiveArray = ![[[values objectAtIndex:0] class] isSubclassOfClass:[NSDictionary class]];
if (primitiveArray) {
return [self parsePrimitiveValues:values dictionary:dictionary parentObject:parentObject];
} else {
DCArrayMapping *mapper = [self.configuration arrayMapperForMapper:attribute.objectMapping parentObject:parentObject];
if (mapper) {
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:mapper.classForElementsOnArray andConfiguration:self.configuration];
return [parser parseArray:values forParentObject:parentObject];
}
}
return nil;
}
- (id)serializeValue:(id)values forDynamicAttribute:(DCDynamicAttribute *)attribute {
DCGenericConverter* genericConverter = [[DCGenericConverter alloc] initWithConfiguration:self.configuration];
NSMutableArray *valuesHolder = [NSMutableArray array];
for(id value in values){
DCDynamicAttribute *valueClassAsAttribute = [[DCDynamicAttribute alloc] initWithClass:[value class]];
[valuesHolder addObject:[genericConverter serializeValue:value forDynamicAttribute:valueClassAsAttribute]];
}
return [NSArray arrayWithArray:valuesHolder];
}
- (NSArray *)parsePrimitiveValues:(NSArray *)primitiveValues dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
DCSimpleConverter *simpleParser = [[DCSimpleConverter alloc] init];
NSMutableArray *valuesHolder = [NSMutableArray array];
for (id value in primitiveValues) {
DCDynamicAttribute *valueClassAsAttribute = [[DCDynamicAttribute alloc] initWithClass:[value class]];
[valuesHolder addObject:[simpleParser transformValue:value forDynamicAttribute:valueClassAsAttribute dictionary:dictionary parentObject:parentObject]];
}
return [NSArray arrayWithArray:valuesHolder];
}
- (BOOL)canTransformValueForClass:(Class)cls {
return [cls isSubclassOfClass:[NSArray class]];
}
@end
================================================
FILE: KeyValueObjectMapping/DCNSDateConverter.h
================================================
//
// DCNSDateConverter.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCValueConverter.h"
@interface DCNSDateConverter : NSObject <DCValueConverter>
+ (DCNSDateConverter *) dateConverterForPattern: (NSString *) pattern;
@end
================================================
FILE: KeyValueObjectMapping/DCNSDateConverter.m
================================================
//
// DCNSDateConverter.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCNSDateConverter.h"
#import "DCDynamicAttribute.h"
@interface DCNSDateConverter()
@property(nonatomic, strong) NSString *pattern;
- (BOOL) validDouble: (NSString *) doubleValue;
@end
@implementation DCNSDateConverter
@synthesize pattern = _pattern;
+ (DCNSDateConverter *) dateConverterForPattern: (NSString *) pattern{
return [[self alloc] initWithDatePattern: pattern];
}
- (id) initWithDatePattern: (NSString *) pattern {
self = [super init];
if (self) {
_pattern = pattern;
}
return self;
}
- (id)transformValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
BOOL validDouble = [self validDouble:[NSString stringWithFormat:@"%@", value]];
if(validDouble){
return [NSDate dateWithTimeIntervalSince1970:[value doubleValue]];
}else{
if ([value isKindOfClass:[NSString class]]) {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = self.pattern;
return [formatter dateFromString:value];
} else {
return nil;
}
}
}
- (id)serializeValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = self.pattern;
return [formatter stringFromDate:value];
}
- (BOOL)canTransformValueForClass: (Class) cls {
return [cls isSubclassOfClass:[NSDate class]];
}
- (BOOL) validDouble: (NSString *) doubleValue {
return [[[NSNumberFormatter alloc] init] numberFromString:doubleValue] != nil;
}
@end
================================================
FILE: KeyValueObjectMapping/DCNSSetConverter.h
================================================
//
// DCNSSetConverter.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 6/13/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCValueConverter.h"
@class DCParserConfiguration;
@interface DCNSSetConverter : NSObject <DCValueConverter>
+ (DCNSSetConverter *) setConverterForConfiguration: (DCParserConfiguration *) configuration;
@end
================================================
FILE: KeyValueObjectMapping/DCNSSetConverter.m
================================================
//
// DCNSSetConverter.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 6/13/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCNSSetConverter.h"
#import "DCNSArrayConverter.h"
#import "DCDynamicAttribute.h"
@interface DCNSSetConverter()
@property(nonatomic, strong) DCParserConfiguration *configuration;
@property(nonatomic, strong) DCNSArrayConverter *arrayConverter;
@end
@implementation DCNSSetConverter
@synthesize arrayConverter = _arrayConverter;
@synthesize configuration = _configuration;
+ (DCNSSetConverter *) setConverterForConfiguration: (DCParserConfiguration *) configuration {
return [[self alloc] initWithConfiguration: configuration];
}
- (id)initWithConfiguration: (DCParserConfiguration *) configuration {
self = [super init];
if (self) {
self.configuration = configuration;
self.arrayConverter = [DCNSArrayConverter arrayConverterForConfiguration:self.configuration];
}
return self;
}
- (id)transformValue:(id)values forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
NSArray *result = [self.arrayConverter transformValue:values forDynamicAttribute:attribute dictionary:dictionary parentObject:parentObject];
return [NSSet setWithArray:result];
}
- (id)serializeValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute {
return [self.arrayConverter serializeValue:value forDynamicAttribute:attribute];
}
- (BOOL)canTransformValueForClass:(Class)cls {
return [cls isSubclassOfClass:[NSSet class]];
}
@end
================================================
FILE: KeyValueObjectMapping/DCNSURLConverter.h
================================================
//
// DCNSURLConverter.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCValueConverter.h"
@interface DCNSURLConverter : NSObject <DCValueConverter>
+ (DCNSURLConverter *) urlConverter;
@end
================================================
FILE: KeyValueObjectMapping/DCNSURLConverter.m
================================================
//
// DCNSURLConverter.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCNSURLConverter.h"
#import "DCDynamicAttribute.h"
@implementation DCNSURLConverter
+ (DCNSURLConverter *) urlConverter {
return [[self alloc] init];
}
- (id)transformValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
if ([value isKindOfClass:[NSString class]]) {
return [NSURL URLWithString:[value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
}
return nil;
}
- (id)serializeValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute {
return [((NSURL *)value) absoluteString];
}
- (BOOL)canTransformValueForClass: (Class) cls {
return [cls isSubclassOfClass:[NSURL class]];
}
@end
================================================
FILE: KeyValueObjectMapping/DCObjectMapping.h
================================================
//
// DCObjectMapping.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/16/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCValueConverter.h"
#import "DCMapping.h"
@interface DCObjectMapping : NSObject <DCMapping>
@property(nonatomic, readonly) NSString *keyReference;
@property(nonatomic, readonly) NSString *attributeName;
@property(nonatomic, readonly) Class classReference;
@property(nonatomic, readonly) id <DCValueConverter> converter;
+ (DCObjectMapping *) mapKeyPath: (NSString *) keyPath
toAttribute: (NSString *) attributeName
onClass: (Class) attributeClass;
+ (DCObjectMapping *) mapKeyPath: (NSString *) keyPath
toAttribute: (NSString *) attributeName
onClass: (Class) attributeClass
converter:(id <DCValueConverter>)converter;
- (id)initWithClass: (Class) classReference;
- (BOOL) sameKey: (NSString *) key andClassReference: (Class) classReference;
@end
================================================
FILE: KeyValueObjectMapping/DCObjectMapping.m
================================================
//
// DCObjectMapping.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/16/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCObjectMapping.h"
@implementation DCObjectMapping
@synthesize attributeName = _attributeName;
@synthesize keyReference = _keyReference;
@synthesize classReference = _classReference;
@synthesize converter = _converter;
- (id)initWithClass: (Class) classReference {
self = [super init];
if (self) {
_classReference = classReference;
}
return self;
}
+ (DCObjectMapping *) mapKeyPath: (NSString *) keyPath
toAttribute: (NSString *) attributeName
onClass: (Class) attributeClass {
return [[self alloc] initWithKeyPath:keyPath
toAttribute:attributeName
onClass:attributeClass
converter:nil];
}
+ (DCObjectMapping *) mapKeyPath: (NSString *) keyPath
toAttribute: (NSString *) attributeName
onClass: (Class) attributeClass
converter:(id <DCValueConverter>)converter {
return [[self alloc] initWithKeyPath:keyPath
toAttribute:attributeName
onClass:attributeClass
converter:converter];
}
- (id)initWithKeyPath: (NSString *) keyReference
toAttribute: (NSString *) attributeName
onClass: (Class) classReference
converter: (id <DCValueConverter>) converter {
self = [super init];
if (self) {
_attributeName = attributeName;
_keyReference = keyReference;
_classReference = classReference;
_converter = converter;
}
return self;
}
- (BOOL) sameKey: (NSString *) key andClassReference: (Class) classReference {
BOOL sameProperty = [self.keyReference isEqualToString:key];
if( sameProperty && self.classReference == classReference){
return YES;
}
return NO;
}
@end
================================================
FILE: KeyValueObjectMapping/DCParserConfiguration.h
================================================
//
// DCParserConfiguration.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCMapping.h"
@class DCArrayMapping, DCPropertyAggregator, DCObjectMapping, DCCustomInitialize, DCCustomParser;
@interface DCParserConfiguration : NSObject
@property(nonatomic, strong) NSString *datePattern;
@property(nonatomic, strong) NSString *splitToken;
@property(nonatomic, strong) NSString *nestedPrepertiesSplitToken;
@property(nonatomic, readonly) NSMutableArray *objectMappers;
@property(nonatomic, readonly) NSMutableArray *aggregators;
@property(nonatomic, readonly) NSMutableArray *customInitializers;
@property(nonatomic, readonly) NSMutableArray *customParsers;
+ (DCParserConfiguration *) configuration;
- (void)addMapper: (id<DCMapping>)mapper;
- (void) addArrayMapper: (DCArrayMapping *)mapper;
- (void) addObjectMapping: (DCObjectMapping *) mapper;
- (void) addObjectMappings: (NSArray *)mappers;
- (void) addAggregator: (DCPropertyAggregator *) aggregator;
- (void) addCustomInitializersObject:(DCCustomInitialize *) customInitialize;
- (void) addCustomParsersObject:(DCCustomParser *)parser;
- (id)instantiateObjectForClass:(Class)classOfObjectToGenerate withValues:(NSDictionary *)values;
- (id)instantiateObjectForClass:(Class)classOfObjectToGenerate withValues:(NSDictionary *)values parentObject:(id)parentObject;
- (DCArrayMapping *) arrayMapperForMapper: (DCObjectMapping *) mapper parentObject:(id)parentObject;
@end
================================================
FILE: KeyValueObjectMapping/DCParserConfiguration.m
================================================
//
// DCParserConfiguration.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCParserConfiguration.h"
#import "DCArrayMapping.h"
#import "DCPropertyAggregator.h"
#import "DCCustomInitialize.h"
@interface DCParserConfiguration()
@property(nonatomic, strong) NSMutableArray *arrayMappers;
@end
@implementation DCParserConfiguration
@synthesize datePattern = _datePattern;
@synthesize splitToken = _splitToken;
@synthesize arrayMappers = _arrayMappers;
@synthesize objectMappers = _objectMappers;
@synthesize aggregators = _aggregators;
@synthesize customInitializers = _customInitializers;
@synthesize customParsers = _customParsers;
+ (DCParserConfiguration *) configuration {
return [[self alloc] init];
}
- (id)init {
self = [super init];
if (self) {
_arrayMappers = [[NSMutableArray alloc] init];
_objectMappers = [[NSMutableArray alloc] init];
_aggregators = [[NSMutableArray alloc] init];
_customInitializers = [[NSMutableArray alloc] init];
_customParsers = [[NSMutableArray alloc] init];
_splitToken = @"_";
_nestedPrepertiesSplitToken = @".";
_datePattern = @"eee MMM dd HH:mm:ss ZZZZ yyyy";
}
return self;
}
- (void)setSplitToken:(NSString *)splitToken
{
if (splitToken &&
![splitToken isEqualToString:_splitToken] &&
![splitToken isEqualToString:_nestedPrepertiesSplitToken]) {
_splitToken = splitToken;
}
}
- (void)addMapper: (id<DCMapping>)mapper {
if ([mapper isKindOfClass:[DCArrayMapping class]]){
[self addArrayMapper:mapper];
} else if ([mapper isKindOfClass:[DCObjectMapping class]]){
[self addObjectMapping:mapper];
} else {
@throw [NSException exceptionWithName:NSInternalInconsistencyException
reason:[NSString stringWithFormat:@"unknown mapper class: %@", NSStringFromClass([mapper class])]
userInfo:nil];
}
}
- (void)addArrayMapper: (DCArrayMapping *)mapper {
[self.arrayMappers addObject:mapper];
[self.objectMappers addObject:mapper.objectMapping];
}
- (void) addObjectMapping: (DCObjectMapping *) mapper {
[self.objectMappers addObject:mapper];
}
- (void) addObjectMappings: (NSArray *)mappers {
for (DCObjectMapping *mapper in mappers) {
[self.objectMappers addObject:mapper];
}
}
- (void) addAggregator: (DCPropertyAggregator *) aggregator {
[self.aggregators addObject:aggregator];
}
- (void) addCustomInitializersObject:(DCCustomInitialize *) customInitialize {
[self.customInitializers addObject:customInitialize];
}
- (void) addCustomParsersObject:(DCCustomParser *)parser {
[self.customParsers addObject:parser];
}
- (id)instantiateObjectForClass:(Class)classOfObjectToGenerate withValues:(NSDictionary *)values {
return [self instantiateObjectForClass:classOfObjectToGenerate withValues:values parentObject:nil];
}
- (id)instantiateObjectForClass:(Class)classOfObjectToGenerate withValues:(NSDictionary *)values parentObject:(id)parentObject {
for(DCCustomInitialize *customInitialize in self.customInitializers){
if([customInitialize isValidToPerformBlock:classOfObjectToGenerate]){
return customInitialize.blockInitialize(classOfObjectToGenerate, values, parentObject);
}
}
return [[classOfObjectToGenerate alloc] init];
}
- (DCArrayMapping *) arrayMapperForMapper: (DCObjectMapping *) mapper parentObject:(id)parentObject {
for(DCArrayMapping *arrayMapper in self.arrayMappers){
DCObjectMapping *mapping = arrayMapper.objectMapping;
BOOL sameClass = [parentObject class] == mapping.classReference;
BOOL sameKey = [mapping.keyReference isEqualToString:mapper.keyReference];
BOOL sameAttributeName = [mapping.attributeName isEqualToString:mapper.attributeName];
BOOL sameAttributeNameWithUnderscore = [[self addUnderScoreToPropertyName:mapping.attributeName] isEqualToString:mapper.attributeName];
if(sameClass && sameKey && (sameAttributeName || sameAttributeNameWithUnderscore)){
return arrayMapper;
}
}
return nil;
}
- (NSString *) addUnderScoreToPropertyName: (NSString *) key{
if(!key || [key isEqualToString:@""]){
return @"";
}
return [NSString stringWithFormat:@"_%@", key];
}
@end
================================================
FILE: KeyValueObjectMapping/DCPropertyAggregator.h
================================================
//
// DCPropertyAggregator.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DCPropertyAggregator : NSObject
@property(nonatomic, readonly) NSSet *keysToAggregate;
@property(nonatomic, readonly) NSString *attribute;
+ (DCPropertyAggregator *) aggregateKeys: (NSSet *) keys intoAttribute: (NSString *) attribute;
- (NSDictionary *) aggregateKeysOnDictionary: (NSDictionary *) baseDictionary;
@end
================================================
FILE: KeyValueObjectMapping/DCPropertyAggregator.m
================================================
//
// DCPropertyAggregator.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCPropertyAggregator.h"
@implementation DCPropertyAggregator
@synthesize keysToAggregate = _keysToAggregate;
@synthesize attribute = _attribute;
+ (DCPropertyAggregator *) aggregateKeys: (NSSet *) keys intoAttribute: (NSString *) attribute {
return [[self alloc] initWithKeysToAggregate:keys intoAttribute:attribute];
}
- (id)initWithKeysToAggregate: (NSSet *) keysToAggregate intoAttribute: (NSString *) attribute {
self = [super init];
if (self) {
_keysToAggregate = keysToAggregate;
_attribute = attribute;
}
return self;
}
- (NSDictionary *) aggregateKeysOnDictionary: (NSDictionary *) baseDictionary {
NSMutableDictionary *aggregateHolder = [[NSMutableDictionary alloc] init];
for (NSString *key in baseDictionary) {
if([self.keysToAggregate containsObject:key]){
[aggregateHolder setValue:[baseDictionary objectForKey:key] forKey:key];
}
}
return [NSDictionary dictionaryWithDictionary:aggregateHolder];
}
@end
================================================
FILE: KeyValueObjectMapping/DCPropertyFinder.h
================================================
//
// DCPropertyFinder.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/17/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCDynamicAttribute.h"
#import "DCReferenceKeyParser.h"
@interface DCPropertyFinder : NSObject
@property(nonatomic, strong) NSArray *mappers;
+ (DCPropertyFinder *) finderWithKeyParser: (DCReferenceKeyParser *) keyParser;
- (DCDynamicAttribute *) findAttributeForKey: (NSString *) key
onClass: (Class) className;
@end
================================================
FILE: KeyValueObjectMapping/DCPropertyFinder.m
================================================
//
// DCPropertyFinder.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/17/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCPropertyFinder.h"
#import <objc/runtime.h>
@interface DCPropertyFinder()
@property(nonatomic, strong) DCReferenceKeyParser *keyParser;
@end
@implementation DCPropertyFinder
@synthesize keyParser = _keyParser;
@synthesize mappers = _mappers;
#pragma mark - public methods
+ (DCPropertyFinder *) finderWithKeyParser: (DCReferenceKeyParser *) _keyParser {
return [[self alloc] initWithKeyParser:_keyParser];
}
- (DCDynamicAttribute *) findAttributeForKey: (NSString *) key onClass: (Class) cls {
NSString *originalKey = key;
DCObjectMapping *mapper = [self findMapperForKey:key onClass:cls];
if(mapper){
key = mapper.attributeName;
}
NSString *propertyDetails = [self findPropertyDetailsForKey:key onClass:cls];
if(!propertyDetails){
key = [self.keyParser splitKeyAndMakeCamelcased:key];
propertyDetails = [self findPropertyDetailsForKey:key onClass:cls];
}
if(!propertyDetails)
return nil;
DCDynamicAttribute *dynamicAttribute;
if (mapper && mapper.converter) {
dynamicAttribute = [[DCDynamicAttribute alloc] initWithAttributeDescription:propertyDetails
forKey:originalKey
onClass:cls
attributeName:key
converter:mapper.converter];
}
else {
dynamicAttribute = [[DCDynamicAttribute alloc] initWithAttributeDescription:propertyDetails
forKey:originalKey
onClass:cls
attributeName:key];
}
return dynamicAttribute;
}
- (void) setMappers: (NSArray *) mappers{
_mappers = [NSArray arrayWithArray:mappers];
}
#pragma mark - private methods
- (id)initWithKeyParser: (DCReferenceKeyParser *) keyParser {
self = [super init];
if (self) {
_keyParser = keyParser;
_mappers = [[NSMutableArray alloc] init];
}
return self;
}
- (NSString *) findPropertyDetailsForKey: (NSString *)key onClass: (Class)cls{
objc_property_t property = class_getProperty(cls, [key UTF8String]);
if (property) {
NSString *attributeDetails = [NSString stringWithUTF8String:property_getAttributes(property)];
return attributeDetails;
}
return nil;
}
- (DCObjectMapping *) findMapperForKey: (NSString *) key onClass: (Class) cls {
for(DCObjectMapping *mapper in self.mappers){
if([mapper sameKey:key andClassReference:cls]){
return mapper;
}
}
return nil;
}
@end
================================================
FILE: KeyValueObjectMapping/DCReferenceKeyParser.h
================================================
//
// DCReferenceKeyParser.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/14/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DCReferenceKeyParser : NSObject
@property(nonatomic, readonly) NSString *splitToken;
+ (DCReferenceKeyParser *) parserForToken: (NSString *) splitToken;
- (NSString *) splitKeyAndMakeCamelcased: (NSString *) key;
@end
================================================
FILE: KeyValueObjectMapping/DCReferenceKeyParser.m
================================================
//
// DCReferenceKeyParser.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/14/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCReferenceKeyParser.h"
@implementation DCReferenceKeyParser
@synthesize splitToken;
+ (DCReferenceKeyParser *) parserForToken: (NSString *) _splitToken {
return [[self alloc] initWithSplitToken:_splitToken];
}
- (id)initWithSplitToken: (NSString *) _splitToken
{
self = [super init];
if (self) {
splitToken = _splitToken;
}
return self;
}
- (NSString *) splitKeyAndMakeCamelcased: (NSString *) key {
if(!key || [key isEqualToString:@""] || splitToken == nil)
return @"";
NSArray *splitedKeys = [key componentsSeparatedByString:splitToken];
NSMutableString *parsedKeyName = [NSMutableString string];
[parsedKeyName appendString:[[splitedKeys objectAtIndex:0] lowercaseString]];
for(int i=1; i<[splitedKeys count]; i++){
NSString *splitedKey = [splitedKeys objectAtIndex:i];
if (splitedKey.length > 0)
{
[parsedKeyName appendString:[[splitedKey substringWithRange:NSMakeRange(0, 1)] uppercaseString]];
[parsedKeyName appendString:[[splitedKey substringFromIndex:1] lowercaseString]];
}
}
return [NSString stringWithString:parsedKeyName];
}
@end
================================================
FILE: KeyValueObjectMapping/DCSimpleConverter.h
================================================
//
// DCSimpleConverter.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCValueConverter.h"
@interface DCSimpleConverter : NSObject <DCValueConverter>
@end
================================================
FILE: KeyValueObjectMapping/DCSimpleConverter.m
================================================
//
// DCSimpleConverter.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCSimpleConverter.h"
#import "DCDynamicAttribute.h"
@implementation DCSimpleConverter
- (id)transformValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
return value;
}
-(id)serializeValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute{
return value;
}
- (BOOL)canTransformValueForClass:(Class)cls {
return YES;
}
@end
================================================
FILE: KeyValueObjectMapping/DCValueConverter.h
================================================
//
// DCValueConverter.h
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <Foundation/Foundation.h>
@class DCDynamicAttribute, DCParserConfiguration;
@protocol DCValueConverter <NSObject>
@required
- (id)transformValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject;
- (id)serializeValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute;
- (BOOL)canTransformValueForClass:(Class)cls;
@end
================================================
FILE: KeyValueObjectMapping/KeyValueObjectMapping-Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>br.com.dchohfi.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
================================================
FILE: KeyValueObjectMapping/KeyValueObjectMapping-Prefix.pch
================================================
//
// Prefix header for all source files of the 'KeyValueObjectMapping' target in the 'KeyValueObjectMapping' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif
================================================
FILE: KeyValueObjectMapping/NSObject+DCKeyValueObjectMapping.h
================================================
//
// NSObject+DCKeyValueObjectMapping.h
// KeyValueObjectMapping
//
// Created by Benjamin Petit on 06/12/2013.
// Copyright (c) 2013 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DCParserConfiguration.h"
@interface NSObject (DCKeyValueObjectMapping)
+ (instancetype)dc_parseDictionary:(NSDictionary *)dictionary;
+ (instancetype)dc_parseDictionary:(NSDictionary *)dictionary configuration:(DCParserConfiguration *)configuration;
+ (NSArray *)dc_parseArray:(NSArray *)array;
+ (NSArray *)dc_parseArray:(NSArray *)array configuration:(DCParserConfiguration *)configuration;
- (void)dc_updateWithDictionary:(NSDictionary *)dictionary;
- (void)dc_updateWithDictionary:(NSDictionary *)dictionary configuration:(DCParserConfiguration *)configuration;
@end
================================================
FILE: KeyValueObjectMapping/NSObject+DCKeyValueObjectMapping.m
================================================
//
// NSObject+DCKeyValueObjectMapping.m
// KeyValueObjectMapping
//
// Created by Benjamin Petit on 06/12/2013.
// Copyright (c) 2013 dchohfi. All rights reserved.
//
#import "NSObject+DCKeyValueObjectMapping.h"
#import "DCKeyValueObjectMapping.h"
@implementation NSObject (DCKeyValueObjectMapping)
+ (instancetype)dc_parseDictionary:(NSDictionary *)dictionary
{
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:self];
return [parser parseDictionary:dictionary];
}
+ (instancetype)dc_parseDictionary:(NSDictionary *)dictionary configuration:(DCParserConfiguration *)configuration
{
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:self andConfiguration:configuration];
return [parser parseDictionary:dictionary];
}
+ (NSArray *)dc_parseArray:(NSArray *)array
{
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:self];
return [parser parseArray:array];
}
+ (NSArray *)dc_parseArray:(NSArray *)array configuration:(DCParserConfiguration *)configuration
{
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:self andConfiguration:configuration];
return [parser parseArray:array];
}
- (void)dc_updateWithDictionary:(NSDictionary *)dictionary
{
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[self class]];
return [parser updateObject:self withDictionary:dictionary];
}
- (void)dc_updateWithDictionary:(NSDictionary *)dictionary configuration:(DCParserConfiguration *)configuration
{
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[self class] andConfiguration:configuration];
return [parser updateObject:self withDictionary:dictionary];
}
@end
================================================
FILE: KeyValueObjectMapping.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
201F6F53153F31FD009A24B9 /* DCCoverageFix.m in Sources */ = {isa = PBXBuildFile; fileRef = 201F6F52153F31FD009A24B9 /* DCCoverageFix.m */; };
201F6F5E153F56BE009A24B9 /* DCPropertyAggregator.h in Headers */ = {isa = PBXBuildFile; fileRef = 201F6F5C153F56BE009A24B9 /* DCPropertyAggregator.h */; settings = {ATTRIBUTES = (Public, ); }; };
201F6F5F153F56BE009A24B9 /* DCPropertyAggregator.m in Sources */ = {isa = PBXBuildFile; fileRef = 201F6F5D153F56BE009A24B9 /* DCPropertyAggregator.m */; };
201F6F63153F632F009A24B9 /* Bus.m in Sources */ = {isa = PBXBuildFile; fileRef = 201F6F62153F632F009A24B9 /* Bus.m */; };
201F6F66153F6355009A24B9 /* Location.m in Sources */ = {isa = PBXBuildFile; fileRef = 201F6F65153F6355009A24B9 /* Location.m */; };
201F6F6B153F6421009A24B9 /* DCPropertyAggregatorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 201F6F6A153F6421009A24B9 /* DCPropertyAggregatorTests.m */; };
201F6F6F153F789A009A24B9 /* DCAttributeSetter.h in Headers */ = {isa = PBXBuildFile; fileRef = 201F6F6D153F789A009A24B9 /* DCAttributeSetter.h */; };
201F6F70153F789A009A24B9 /* DCAttributeSetter.m in Sources */ = {isa = PBXBuildFile; fileRef = 201F6F6E153F789A009A24B9 /* DCAttributeSetter.m */; };
201F6F73153F7C9E009A24B9 /* DCDictionaryRearranger.h in Headers */ = {isa = PBXBuildFile; fileRef = 201F6F71153F7C9E009A24B9 /* DCDictionaryRearranger.h */; settings = {ATTRIBUTES = (Public, ); }; };
201F6F74153F7C9E009A24B9 /* DCDictionaryRearranger.m in Sources */ = {isa = PBXBuildFile; fileRef = 201F6F72153F7C9E009A24B9 /* DCDictionaryRearranger.m */; };
205FD3B4153F02AA00693E13 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 205FD3B3153F02AA00693E13 /* SenTestingKit.framework */; };
205FD3B6153F02AA00693E13 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 205FD3B5153F02AA00693E13 /* UIKit.framework */; };
205FD3B8153F02AA00693E13 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 205FD3B7153F02AA00693E13 /* Foundation.framework */; };
205FD3BB153F02AA00693E13 /* KeyValueObjectMapping.framework in Resources */ = {isa = PBXBuildFile; fileRef = 205FD3A3153F02AA00693E13 /* KeyValueObjectMapping.framework */; };
205FD3C1153F02AA00693E13 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 205FD3BF153F02AA00693E13 /* InfoPlist.strings */; };
205FD3D0153F02F700693E13 /* DCPropertyFinder.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3CE153F02F700693E13 /* DCPropertyFinder.h */; };
205FD3D1153F02F700693E13 /* DCPropertyFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3CF153F02F700693E13 /* DCPropertyFinder.m */; };
205FD3D5153F030800693E13 /* DCReferenceKeyParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3D3153F030800693E13 /* DCReferenceKeyParser.h */; };
205FD3D6153F030800693E13 /* DCReferenceKeyParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3D4153F030800693E13 /* DCReferenceKeyParser.m */; };
205FD3DA153F031C00693E13 /* DCParserConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3D8153F031C00693E13 /* DCParserConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; };
205FD3DB153F031C00693E13 /* DCParserConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3D9153F031C00693E13 /* DCParserConfiguration.m */; };
205FD3E0153F032F00693E13 /* DCValueConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3DD153F032F00693E13 /* DCValueConverter.h */; settings = {ATTRIBUTES = (Public, ); }; };
205FD3E1153F032F00693E13 /* DCGenericConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3DE153F032F00693E13 /* DCGenericConverter.h */; };
205FD3E2153F032F00693E13 /* DCGenericConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3DF153F032F00693E13 /* DCGenericConverter.m */; };
205FD3EC153F033A00693E13 /* DCNSArrayConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3E4153F033A00693E13 /* DCNSArrayConverter.h */; };
205FD3ED153F033A00693E13 /* DCNSArrayConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3E5153F033A00693E13 /* DCNSArrayConverter.m */; };
205FD3EE153F033A00693E13 /* DCNSDateConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3E6153F033A00693E13 /* DCNSDateConverter.h */; };
205FD3EF153F033A00693E13 /* DCNSDateConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3E7153F033A00693E13 /* DCNSDateConverter.m */; };
205FD3F0153F033A00693E13 /* DCNSURLConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3E8153F033A00693E13 /* DCNSURLConverter.h */; };
205FD3F1153F033A00693E13 /* DCNSURLConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3E9153F033A00693E13 /* DCNSURLConverter.m */; };
205FD3F2153F033A00693E13 /* DCSimpleConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3EA153F033A00693E13 /* DCSimpleConverter.h */; };
205FD3F3153F033A00693E13 /* DCSimpleConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3EB153F033A00693E13 /* DCSimpleConverter.m */; };
205FD3FB153F034D00693E13 /* DCDynamicAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3F5153F034D00693E13 /* DCDynamicAttribute.h */; };
205FD3FC153F034D00693E13 /* DCDynamicAttribute.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3F6153F034D00693E13 /* DCDynamicAttribute.m */; };
205FD3FD153F034D00693E13 /* DCObjectMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3F7153F034D00693E13 /* DCObjectMapping.h */; settings = {ATTRIBUTES = (Public, ); }; };
205FD3FE153F034D00693E13 /* DCObjectMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3F8153F034D00693E13 /* DCObjectMapping.m */; };
205FD3FF153F034D00693E13 /* DCArrayMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD3F9153F034D00693E13 /* DCArrayMapping.h */; settings = {ATTRIBUTES = (Public, ); }; };
205FD400153F034D00693E13 /* DCArrayMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD3FA153F034D00693E13 /* DCArrayMapping.m */; };
205FD403153F035700693E13 /* DCKeyValueObjectMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 205FD401153F035700693E13 /* DCKeyValueObjectMapping.h */; settings = {ATTRIBUTES = (Public, ); }; };
205FD404153F035700693E13 /* DCKeyValueObjectMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD402153F035700693E13 /* DCKeyValueObjectMapping.m */; };
205FD40D153F03F000693E13 /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD408153F03F000693E13 /* Person.m */; };
205FD40E153F03F000693E13 /* Tweet.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD40A153F03F000693E13 /* Tweet.m */; };
205FD40F153F03F000693E13 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD40C153F03F000693E13 /* User.m */; };
205FD41D153F040900693E13 /* KeyValueObjectMappingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD413153F040900693E13 /* KeyValueObjectMappingTests.m */; };
205FD41E153F040900693E13 /* DCDynamicAttributeTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD415153F040900693E13 /* DCDynamicAttributeTest.m */; };
205FD41F153F040900693E13 /* DCPropertyFinderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD417153F040900693E13 /* DCPropertyFinderTests.m */; };
205FD420153F040900693E13 /* DCArrayOfTweetsOnUserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD419153F040900693E13 /* DCArrayOfTweetsOnUserTests.m */; };
205FD421153F040900693E13 /* DCReferenceKeyParserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 205FD41B153F040900693E13 /* DCReferenceKeyParserTests.m */; };
205FD425153F041F00693E13 /* plist.plist in Resources */ = {isa = PBXBuildFile; fileRef = 205FD422153F041F00693E13 /* plist.plist */; };
205FD426153F041F00693E13 /* tweet.json in Resources */ = {isa = PBXBuildFile; fileRef = 205FD423153F041F00693E13 /* tweet.json */; };
205FD427153F041F00693E13 /* user.json in Resources */ = {isa = PBXBuildFile; fileRef = 205FD424153F041F00693E13 /* user.json */; };
2077210015E3E406000A4FA3 /* DCCustomInitialize.h in Headers */ = {isa = PBXBuildFile; fileRef = 207720FE15E3E406000A4FA3 /* DCCustomInitialize.h */; settings = {ATTRIBUTES = (Public, ); }; };
2077210115E3E406000A4FA3 /* DCCustomInitialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 207720FF15E3E406000A4FA3 /* DCCustomInitialize.m */; };
2077210615E3F9FD000A4FA3 /* DCCustomInitializeTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 2077210515E3F9FD000A4FA3 /* DCCustomInitializeTest.m */; };
2077210915E40084000A4FA3 /* DCParserConfigurationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 2077210815E40083000A4FA3 /* DCParserConfigurationTest.m */; };
20D0C2C115F51569001B7278 /* DCCustomParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 20D0C2BF15F51569001B7278 /* DCCustomParser.h */; };
20D0C2C215F51569001B7278 /* DCCustomParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 20D0C2C015F51569001B7278 /* DCCustomParser.m */; };
20D0C2C915F54895001B7278 /* DCCustomParserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20D0C2C815F54895001B7278 /* DCCustomParserTests.m */; };
20D62C1F1588EF2F00484122 /* DCNSSetConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 20D62C1D1588EF2F00484122 /* DCNSSetConverter.h */; };
20D62C201588EF2F00484122 /* DCNSSetConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 20D62C1E1588EF2F00484122 /* DCNSSetConverter.m */; };
20D62C241588F8D700484122 /* DCSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 20D62C231588F8D700484122 /* DCSerializationTests.m */; };
2840FF7615E827F40047AF2E /* DCNSDateConverterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2840FF7515E827F40047AF2E /* DCNSDateConverterTests.m */; };
B5FD89B21851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = B5FD89B01851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.h */; settings = {ATTRIBUTES = (Public, ); }; };
B5FD89B31851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.m in Sources */ = {isa = PBXBuildFile; fileRef = B5FD89B11851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.m */; };
B5FD89B51851D21600EB816F /* NSObject+DCKeyValueObjectMappingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5FD89B41851D21600EB816F /* NSObject+DCKeyValueObjectMappingTests.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
205FD3B9153F02AA00693E13 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 205FD396153F02AA00693E13 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 205FD3A2153F02AA00693E13;
remoteInfo = KeyValueObjectMapping;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
201F6F51153F31FD009A24B9 /* DCCoverageFix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCCoverageFix.h; sourceTree = "<group>"; };
201F6F52153F31FD009A24B9 /* DCCoverageFix.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCCoverageFix.m; sourceTree = "<group>"; };
201F6F5C153F56BE009A24B9 /* DCPropertyAggregator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPropertyAggregator.h; sourceTree = "<group>"; };
201F6F5D153F56BE009A24B9 /* DCPropertyAggregator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCPropertyAggregator.m; sourceTree = "<group>"; };
201F6F61153F632F009A24B9 /* Bus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bus.h; sourceTree = "<group>"; };
201F6F62153F632F009A24B9 /* Bus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Bus.m; sourceTree = "<group>"; };
201F6F64153F6355009A24B9 /* Location.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Location.h; sourceTree = "<group>"; };
201F6F65153F6355009A24B9 /* Location.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Location.m; sourceTree = "<group>"; };
201F6F69153F6421009A24B9 /* DCPropertyAggregatorTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPropertyAggregatorTests.h; sourceTree = "<group>"; };
201F6F6A153F6421009A24B9 /* DCPropertyAggregatorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCPropertyAggregatorTests.m; sourceTree = "<group>"; };
201F6F6D153F789A009A24B9 /* DCAttributeSetter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCAttributeSetter.h; sourceTree = "<group>"; };
201F6F6E153F789A009A24B9 /* DCAttributeSetter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCAttributeSetter.m; sourceTree = "<group>"; };
201F6F71153F7C9E009A24B9 /* DCDictionaryRearranger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCDictionaryRearranger.h; sourceTree = "<group>"; };
201F6F72153F7C9E009A24B9 /* DCDictionaryRearranger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCDictionaryRearranger.m; sourceTree = "<group>"; };
205FD3A3153F02AA00693E13 /* KeyValueObjectMapping.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KeyValueObjectMapping.framework; sourceTree = BUILT_PRODUCTS_DIR; };
205FD3A7153F02AA00693E13 /* KeyValueObjectMapping-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "KeyValueObjectMapping-Info.plist"; sourceTree = "<group>"; };
205FD3AB153F02AA00693E13 /* KeyValueObjectMapping-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KeyValueObjectMapping-Prefix.pch"; sourceTree = "<group>"; };
205FD3B1153F02AA00693E13 /* KeyValueObjectMappingTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KeyValueObjectMappingTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
205FD3B3153F02AA00693E13 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
205FD3B5153F02AA00693E13 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
205FD3B7153F02AA00693E13 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
205FD3BE153F02AA00693E13 /* KeyValueObjectMappingTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "KeyValueObjectMappingTests-Info.plist"; sourceTree = "<group>"; };
205FD3C0153F02AA00693E13 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
205FD3CE153F02F700693E13 /* DCPropertyFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPropertyFinder.h; sourceTree = "<group>"; };
205FD3CF153F02F700693E13 /* DCPropertyFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCPropertyFinder.m; sourceTree = "<group>"; };
205FD3D3153F030800693E13 /* DCReferenceKeyParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCReferenceKeyParser.h; sourceTree = "<group>"; };
205FD3D4153F030800693E13 /* DCReferenceKeyParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCReferenceKeyParser.m; sourceTree = "<group>"; };
205FD3D8153F031C00693E13 /* DCParserConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCParserConfiguration.h; sourceTree = "<group>"; };
205FD3D9153F031C00693E13 /* DCParserConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCParserConfiguration.m; sourceTree = "<group>"; };
205FD3DD153F032F00693E13 /* DCValueConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCValueConverter.h; sourceTree = "<group>"; };
205FD3DE153F032F00693E13 /* DCGenericConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCGenericConverter.h; sourceTree = "<group>"; };
205FD3DF153F032F00693E13 /* DCGenericConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCGenericConverter.m; sourceTree = "<group>"; };
205FD3E4153F033A00693E13 /* DCNSArrayConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCNSArrayConverter.h; sourceTree = "<group>"; };
205FD3E5153F033A00693E13 /* DCNSArrayConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCNSArrayConverter.m; sourceTree = "<group>"; };
205FD3E6153F033A00693E13 /* DCNSDateConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCNSDateConverter.h; sourceTree = "<group>"; };
205FD3E7153F033A00693E13 /* DCNSDateConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCNSDateConverter.m; sourceTree = "<group>"; };
205FD3E8153F033A00693E13 /* DCNSURLConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCNSURLConverter.h; sourceTree = "<group>"; };
205FD3E9153F033A00693E13 /* DCNSURLConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCNSURLConverter.m; sourceTree = "<group>"; };
205FD3EA153F033A00693E13 /* DCSimpleConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCSimpleConverter.h; sourceTree = "<group>"; };
205FD3EB153F033A00693E13 /* DCSimpleConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCSimpleConverter.m; sourceTree = "<group>"; };
205FD3F5153F034D00693E13 /* DCDynamicAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCDynamicAttribute.h; sourceTree = "<group>"; };
205FD3F6153F034D00693E13 /* DCDynamicAttribute.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCDynamicAttribute.m; sourceTree = "<group>"; };
205FD3F7153F034D00693E13 /* DCObjectMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCObjectMapping.h; sourceTree = "<group>"; };
205FD3F8153F034D00693E13 /* DCObjectMapping.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCObjectMapping.m; sourceTree = "<group>"; };
205FD3F9153F034D00693E13 /* DCArrayMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCArrayMapping.h; sourceTree = "<group>"; };
205FD3FA153F034D00693E13 /* DCArrayMapping.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCArrayMapping.m; sourceTree = "<group>"; };
205FD401153F035700693E13 /* DCKeyValueObjectMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCKeyValueObjectMapping.h; sourceTree = "<group>"; };
205FD402153F035700693E13 /* DCKeyValueObjectMapping.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCKeyValueObjectMapping.m; sourceTree = "<group>"; };
205FD407153F03F000693E13 /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = "<group>"; };
205FD408153F03F000693E13 /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = "<group>"; };
205FD409153F03F000693E13 /* Tweet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tweet.h; sourceTree = "<group>"; };
205FD40A153F03F000693E13 /* Tweet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tweet.m; sourceTree = "<group>"; };
205FD40B153F03F000693E13 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; };
205FD40C153F03F000693E13 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; };
205FD412153F040900693E13 /* KeyValueObjectMappingTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyValueObjectMappingTests.h; sourceTree = "<group>"; };
205FD413153F040900693E13 /* KeyValueObjectMappingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KeyValueObjectMappingTests.m; sourceTree = "<group>"; };
205FD414153F040900693E13 /* DCDynamicAttributeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCDynamicAttributeTest.h; sourceTree = "<group>"; };
205FD415153F040900693E13 /* DCDynamicAttributeTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCDynamicAttributeTest.m; sourceTree = "<group>"; };
205FD416153F040900693E13 /* DCPropertyFinderTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCPropertyFinderTests.h; sourceTree = "<group>"; };
205FD417153F040900693E13 /* DCPropertyFinderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCPropertyFinderTests.m; sourceTree = "<group>"; };
205FD418153F040900693E13 /* DCArrayOfTweetsOnUserTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCArrayOfTweetsOnUserTests.h; sourceTree = "<group>"; };
205FD419153F040900693E13 /* DCArrayOfTweetsOnUserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCArrayOfTweetsOnUserTests.m; sourceTree = "<group>"; };
205FD41A153F040900693E13 /* DCReferenceKeyParserTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCReferenceKeyParserTests.h; sourceTree = "<group>"; };
205FD41B153F040900693E13 /* DCReferenceKeyParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCReferenceKeyParserTests.m; sourceTree = "<group>"; };
205FD422153F041F00693E13 /* plist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = plist.plist; sourceTree = "<group>"; };
205FD423153F041F00693E13 /* tweet.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = tweet.json; sourceTree = "<group>"; };
205FD424153F041F00693E13 /* user.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = user.json; sourceTree = "<group>"; };
207720FE15E3E406000A4FA3 /* DCCustomInitialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCCustomInitialize.h; sourceTree = "<group>"; };
207720FF15E3E406000A4FA3 /* DCCustomInitialize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCCustomInitialize.m; sourceTree = "<group>"; };
2077210415E3F9FD000A4FA3 /* DCCustomInitializeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCCustomInitializeTest.h; sourceTree = "<group>"; };
2077210515E3F9FD000A4FA3 /* DCCustomInitializeTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCCustomInitializeTest.m; sourceTree = "<group>"; };
2077210715E40083000A4FA3 /* DCParserConfigurationTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCParserConfigurationTest.h; sourceTree = "<group>"; };
2077210815E40083000A4FA3 /* DCParserConfigurationTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCParserConfigurationTest.m; sourceTree = "<group>"; };
20D0C2BF15F51569001B7278 /* DCCustomParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCCustomParser.h; sourceTree = "<group>"; };
20D0C2C015F51569001B7278 /* DCCustomParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCCustomParser.m; sourceTree = "<group>"; };
20D0C2C715F54895001B7278 /* DCCustomParserTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCCustomParserTests.h; sourceTree = "<group>"; };
20D0C2C815F54895001B7278 /* DCCustomParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCCustomParserTests.m; sourceTree = "<group>"; };
20D62C1D1588EF2F00484122 /* DCNSSetConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCNSSetConverter.h; sourceTree = "<group>"; };
20D62C1E1588EF2F00484122 /* DCNSSetConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCNSSetConverter.m; sourceTree = "<group>"; };
20D62C221588F8D700484122 /* DCSerializationTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCSerializationTests.h; sourceTree = "<group>"; };
20D62C231588F8D700484122 /* DCSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCSerializationTests.m; sourceTree = "<group>"; };
2840FF7415E827F40047AF2E /* DCNSDateConverterTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCNSDateConverterTests.h; sourceTree = "<group>"; };
2840FF7515E827F40047AF2E /* DCNSDateConverterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCNSDateConverterTests.m; sourceTree = "<group>"; };
B5FD89AD1851CED400EB816F /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
B5FD89B01851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+DCKeyValueObjectMapping.h"; sourceTree = "<group>"; };
B5FD89B11851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+DCKeyValueObjectMapping.m"; sourceTree = "<group>"; };
B5FD89B41851D21600EB816F /* NSObject+DCKeyValueObjectMappingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+DCKeyValueObjectMappingTests.m"; sourceTree = "<group>"; };
C12EAC931B0B323A0007247B /* DCMapping.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DCMapping.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
205FD39D153F02AA00693E13 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
205FD3AD153F02AA00693E13 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
205FD3B4153F02AA00693E13 /* SenTestingKit.framework in Frameworks */,
205FD3B6153F02AA00693E13 /* UIKit.framework in Frameworks */,
205FD3B8153F02AA00693E13 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
201F6F6C153F7885009A24B9 /* Setters */ = {
isa = PBXGroup;
children = (
201F6F6D153F789A009A24B9 /* DCAttributeSetter.h */,
201F6F6E153F789A009A24B9 /* DCAttributeSetter.m */,
);
name = Setters;
sourceTree = "<group>";
};
205FD394153F02AA00693E13 = {
isa = PBXGroup;
children = (
205FD3A5153F02AA00693E13 /* KeyValueObjectMapping */,
205FD3BC153F02AA00693E13 /* KeyValueObjectMappingTests */,
205FD3B2153F02AA00693E13 /* Frameworks */,
205FD3A4153F02AA00693E13 /* Products */,
);
sourceTree = "<group>";
};
205FD3A4153F02AA00693E13 /* Products */ = {
isa = PBXGroup;
children = (
205FD3A3153F02AA00693E13 /* KeyValueObjectMapping.framework */,
205FD3B1153F02AA00693E13 /* KeyValueObjectMappingTests.octest */,
);
name = Products;
sourceTree = "<group>";
};
205FD3A5153F02AA00693E13 /* KeyValueObjectMapping */ = {
isa = PBXGroup;
children = (
B5FD89AF1851D14000EB816F /* Categories */,
205FD401153F035700693E13 /* DCKeyValueObjectMapping.h */,
205FD402153F035700693E13 /* DCKeyValueObjectMapping.m */,
205FD3CD153F02EE00693E13 /* Finders */,
201F6F6C153F7885009A24B9 /* Setters */,
205FD3D2153F02FD00693E13 /* Utils */,
2077210315E3E40C000A4FA3 /* Objecs */,
205FD3D7153F030F00693E13 /* Configuration */,
205FD3DC153F032300693E13 /* Converters */,
205FD3F4153F034300693E13 /* Mappers */,
205FD3A6153F02AA00693E13 /* Supporting Files */,
);
path = KeyValueObjectMapping;
sourceTree = "<group>";
};
205FD3A6153F02AA00693E13 /* Supporting Files */ = {
isa = PBXGroup;
children = (
205FD3A7153F02AA00693E13 /* KeyValueObjectMapping-Info.plist */,
205FD3AB153F02AA00693E13 /* KeyValueObjectMapping-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
205FD3B2153F02AA00693E13 /* Frameworks */ = {
isa = PBXGroup;
children = (
B5FD89AD1851CED400EB816F /* libicucore.dylib */,
205FD3B3153F02AA00693E13 /* SenTestingKit.framework */,
205FD3B5153F02AA00693E13 /* UIKit.framework */,
205FD3B7153F02AA00693E13 /* Foundation.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
205FD3BC153F02AA00693E13 /* KeyValueObjectMappingTests */ = {
isa = PBXGroup;
children = (
205FD406153F03E500693E13 /* Model */,
201F6F51153F31FD009A24B9 /* DCCoverageFix.h */,
201F6F52153F31FD009A24B9 /* DCCoverageFix.m */,
205FD412153F040900693E13 /* KeyValueObjectMappingTests.h */,
205FD413153F040900693E13 /* KeyValueObjectMappingTests.m */,
205FD414153F040900693E13 /* DCDynamicAttributeTest.h */,
205FD415153F040900693E13 /* DCDynamicAttributeTest.m */,
205FD416153F040900693E13 /* DCPropertyFinderTests.h */,
205FD417153F040900693E13 /* DCPropertyFinderTests.m */,
205FD418153F040900693E13 /* DCArrayOfTweetsOnUserTests.h */,
205FD419153F040900693E13 /* DCArrayOfTweetsOnUserTests.m */,
205FD41A153F040900693E13 /* DCReferenceKeyParserTests.h */,
205FD41B153F040900693E13 /* DCReferenceKeyParserTests.m */,
201F6F69153F6421009A24B9 /* DCPropertyAggregatorTests.h */,
201F6F6A153F6421009A24B9 /* DCPropertyAggregatorTests.m */,
20D0C2C715F54895001B7278 /* DCCustomParserTests.h */,
20D0C2C815F54895001B7278 /* DCCustomParserTests.m */,
2077210415E3F9FD000A4FA3 /* DCCustomInitializeTest.h */,
2077210515E3F9FD000A4FA3 /* DCCustomInitializeTest.m */,
20D62C231588F8D700484122 /* DCSerializationTests.m */,
20D62C221588F8D700484122 /* DCSerializationTests.h */,
2077210715E40083000A4FA3 /* DCParserConfigurationTest.h */,
2077210815E40083000A4FA3 /* DCParserConfigurationTest.m */,
2840FF7415E827F40047AF2E /* DCNSDateConverterTests.h */,
2840FF7515E827F40047AF2E /* DCNSDateConverterTests.m */,
B5FD89B41851D21600EB816F /* NSObject+DCKeyValueObjectMappingTests.m */,
205FD3BD153F02AA00693E13 /* Supporting Files */,
);
path = KeyValueObjectMappingTests;
sourceTree = "<group>";
};
205FD3BD153F02AA00693E13 /* Supporting Files */ = {
isa = PBXGroup;
children = (
205FD422153F041F00693E13 /* plist.plist */,
205FD423153F041F00693E13 /* tweet.json */,
205FD424153F041F00693E13 /* user.json */,
205FD3BE153F02AA00693E13 /* KeyValueObjectMappingTests-Info.plist */,
205FD3BF153F02AA00693E13 /* InfoPlist.strings */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
205FD3CD153F02EE00693E13 /* Finders */ = {
isa = PBXGroup;
children = (
205FD3CE153F02F700693E13 /* DCPropertyFinder.h */,
205FD3CF153F02F700693E13 /* DCPropertyFinder.m */,
);
name = Finders;
sourceTree = "<group>";
};
205FD3D2153F02FD00693E13 /* Utils */ = {
isa = PBXGroup;
children = (
205FD3D3153F030800693E13 /* DCReferenceKeyParser.h */,
205FD3D4153F030800693E13 /* DCReferenceKeyParser.m */,
201F6F71153F7C9E009A24B9 /* DCDictionaryRearranger.h */,
201F6F72153F7C9E009A24B9 /* DCDictionaryRearranger.m */,
);
name = Utils;
sourceTree = "<group>";
};
205FD3D7153F030F00693E13 /* Configuration */ = {
isa = PBXGroup;
children = (
205FD3D8153F031C00693E13 /* DCParserConfiguration.h */,
205FD3D9153F031C00693E13 /* DCParserConfiguration.m */,
);
name = Configuration;
sourceTree = "<group>";
};
205FD3DC153F032300693E13 /* Converters */ = {
isa = PBXGroup;
children = (
205FD3E3153F033200693E13 /* Implementation */,
205FD3DD153F032F00693E13 /* DCValueConverter.h */,
205FD3DE153F032F00693E13 /* DCGenericConverter.h */,
205FD3DF153F032F00693E13 /* DCGenericConverter.m */,
);
name = Converters;
sourceTree = "<group>";
};
205FD3E3153F033200693E13 /* Implementation */ = {
isa = PBXGroup;
children = (
205FD3E4153F033A00693E13 /* DCNSArrayConverter.h */,
205FD3E5153F033A00693E13 /* DCNSArrayConverter.m */,
20D62C1D1588EF2F00484122 /* DCNSSetConverter.h */,
20D62C1E1588EF2F00484122 /* DCNSSetConverter.m */,
205FD3E6153F033A00693E13 /* DCNSDateConverter.h */,
205FD3E7153F033A00693E13 /* DCNSDateConverter.m */,
205FD3E8153F033A00693E13 /* DCNSURLConverter.h */,
205FD3E9153F033A00693E13 /* DCNSURLConverter.m */,
205FD3EA153F033A00693E13 /* DCSimpleConverter.h */,
205FD3EB153F033A00693E13 /* DCSimpleConverter.m */,
);
name = Implementation;
sourceTree = "<group>";
};
205FD3F4153F034300693E13 /* Mappers */ = {
isa = PBXGroup;
children = (
205FD3F5153F034D00693E13 /* DCDynamicAttribute.h */,
205FD3F6153F034D00693E13 /* DCDynamicAttribute.m */,
205FD3F7153F034D00693E13 /* DCObjectMapping.h */,
205FD3F8153F034D00693E13 /* DCObjectMapping.m */,
205FD3F9153F034D00693E13 /* DCArrayMapping.h */,
205FD3FA153F034D00693E13 /* DCArrayMapping.m */,
201F6F5C153F56BE009A24B9 /* DCPropertyAggregator.h */,
201F6F5D153F56BE009A24B9 /* DCPropertyAggregator.m */,
C12EAC931B0B323A0007247B /* DCMapping.h */,
);
name = Mappers;
sourceTree = "<group>";
};
205FD406153F03E500693E13 /* Model */ = {
isa = PBXGroup;
children = (
205FD407153F03F000693E13 /* Person.h */,
205FD408153F03F000693E13 /* Person.m */,
205FD409153F03F000693E13 /* Tweet.h */,
205FD40A153F03F000693E13 /* Tweet.m */,
205FD40B153F03F000693E13 /* User.h */,
205FD40C153F03F000693E13 /* User.m */,
201F6F61153F632F009A24B9 /* Bus.h */,
201F6F62153F632F009A24B9 /* Bus.m */,
201F6F64153F6355009A24B9 /* Location.h */,
201F6F65153F6355009A24B9 /* Location.m */,
);
name = Model;
sourceTree = "<group>";
};
2077210315E3E40C000A4FA3 /* Objecs */ = {
isa = PBXGroup;
children = (
207720FE15E3E406000A4FA3 /* DCCustomInitialize.h */,
207720FF15E3E406000A4FA3 /* DCCustomInitialize.m */,
20D0C2BF15F51569001B7278 /* DCCustomParser.h */,
20D0C2C015F51569001B7278 /* DCCustomParser.m */,
);
name = Objecs;
sourceTree = "<group>";
};
B5FD89AF1851D14000EB816F /* Categories */ = {
isa = PBXGroup;
children = (
B5FD89B01851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.h */,
B5FD89B11851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.m */,
);
name = Categories;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
205FD39E153F02AA00693E13 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
201F6F5E153F56BE009A24B9 /* DCPropertyAggregator.h in Headers */,
205FD3D0153F02F700693E13 /* DCPropertyFinder.h in Headers */,
205FD3D5153F030800693E13 /* DCReferenceKeyParser.h in Headers */,
B5FD89B21851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.h in Headers */,
205FD3DA153F031C00693E13 /* DCParserConfiguration.h in Headers */,
205FD3E0153F032F00693E13 /* DCValueConverter.h in Headers */,
205FD3E1153F032F00693E13 /* DCGenericConverter.h in Headers */,
205FD3EC153F033A00693E13 /* DCNSArrayConverter.h in Headers */,
205FD3EE153F033A00693E13 /* DCNSDateConverter.h in Headers */,
205FD3F0153F033A00693E13 /* DCNSURLConverter.h in Headers */,
205FD3F2153F033A00693E13 /* DCSimpleConverter.h in Headers */,
205FD3FB153F034D00693E13 /* DCDynamicAttribute.h in Headers */,
205FD3FD153F034D00693E13 /* DCObjectMapping.h in Headers */,
205FD3FF153F034D00693E13 /* DCArrayMapping.h in Headers */,
205FD403153F035700693E13 /* DCKeyValueObjectMapping.h in Headers */,
201F6F6F153F789A009A24B9 /* DCAttributeSetter.h in Headers */,
201F6F73153F7C9E009A24B9 /* DCDictionaryRearranger.h in Headers */,
20D62C1F1588EF2F00484122 /* DCNSSetConverter.h in Headers */,
2077210015E3E406000A4FA3 /* DCCustomInitialize.h in Headers */,
20D0C2C115F51569001B7278 /* DCCustomParser.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
205FD3A2153F02AA00693E13 /* KeyValueObjectMapping */ = {
isa = PBXNativeTarget;
buildConfigurationList = 205FD3C7153F02AA00693E13 /* Build configuration list for PBXNativeTarget "KeyValueObjectMapping" */;
buildPhases = (
205FD39B153F02AA00693E13 /* ShellScript */,
205FD39C153F02AA00693E13 /* Sources */,
205FD39D153F02AA00693E13 /* Frameworks */,
205FD39E153F02AA00693E13 /* Headers */,
205FD39F153F02AA00693E13 /* Resources */,
205FD3A0153F02AA00693E13 /* ShellScript */,
205FD3A1153F02AA00693E13 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = KeyValueObjectMapping;
productName = KeyValueObjectMapping;
productReference = 205FD3A3153F02AA00693E13 /* KeyValueObjectMapping.framework */;
productType = "com.apple.product-type.bundle";
};
205FD3B0153F02AA00693E13 /* KeyValueObjectMappingTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 205FD3CA153F02AA00693E13 /* Build configuration list for PBXNativeTarget "KeyValueObjectMappingTests" */;
buildPhases = (
205FD3AC153F02AA00693E13 /* Sources */,
205FD3AD153F02AA00693E13 /* Frameworks */,
205FD3AE153F02AA00693E13 /* Resources */,
205FD3AF153F02AA00693E13 /* ShellScript */,
);
buildRules = (
);
dependencies = (
205FD3BA153F02AA00693E13 /* PBXTargetDependency */,
);
name = KeyValueObjectMappingTests;
productName = KeyValueObjectMappingTests;
productReference = 205FD3B1153F02AA00693E13 /* KeyValueObjectMappingTests.octest */;
productType = "com.apple.product-type.bundle.ocunit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
205FD396153F02AA00693E13 /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = DC;
LastUpgradeCheck = 0500;
ORGANIZATIONNAME = dchohfi;
};
buildConfigurationList = 205FD399153F02AA00693E13 /* Build configuration list for PBXProject "KeyValueObjectMapping" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 205FD394153F02AA00693E13;
productRefGroup = 205FD3A4153F02AA00693E13 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
205FD3A2153F02AA00693E13 /* KeyValueObjectMapping */,
205FD3B0153F02AA00693E13 /* KeyValueObjectMappingTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
205FD39F153F02AA00693E13 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
205FD3AE153F02AA00693E13 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
205FD3BB153F02AA00693E13 /* KeyValueObjectMapping.framework in Resources */,
205FD3C1153F02AA00693E13 /* InfoPlist.strings in Resources */,
205FD425153F041F00693E13 /* plist.plist in Resources */,
205FD426153F041F00693E13 /* tweet.json in Resources */,
205FD427153F041F00693E13 /* user.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
205FD39B153F02AA00693E13 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n\tUFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Clean other platform if needed\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n\techo \"Platform \\\"$UFW_SDK_PLATFORM\\\" was cleaned recently. Cleaning \\\"$UFW_OTHER_PLATFORM\\\" as well\"\n\techo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\n\txcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\nfi\n\n\n# Make sure we are building from fresh binaries\n\nrm -rf \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\n";
};
205FD3A0153F02AA00693E13 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "HEADERS_ROOT=$SRCROOT/$PRODUCT_NAME\nFRAMEWORK_HEADERS_DIR=\"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Versions/$FRAMEWORK_VERSION/Headers\"\n\n## only header files expected at this point\nPUBLIC_HEADERS=$(find $FRAMEWORK_HEADERS_DIR/. -not -type d 2> /dev/null | sed -e \"s@.*/@@g\")\n\nFIND_OPTS=\"\"\nfor PUBLIC_HEADER in $PUBLIC_HEADERS; do\n if [ -n \"$FIND_OPTS\" ]; then\n FIND_OPTS=\"$FIND_OPTS -o\"\n fi\n FIND_OPTS=\"$FIND_OPTS -name '$PUBLIC_HEADER'\"\ndone\n\nif [ -n \"$FIND_OPTS\" ]; then\n for ORIG_HEADER in $(eval \"find $HEADERS_ROOT/. $FIND_OPTS\" 2> /dev/null | sed -e \"s@^$HEADERS_ROOT/./@@g\"); do\n PUBLIC_HEADER=$(basename $ORIG_HEADER)\n RELATIVE_PATH=$(dirname $ORIG_HEADER)\n if [ -e $FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER ]; then\n mkdir -p \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH\"\n mv \"$FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER\" \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH/$PUBLIC_HEADER\"\n fi\n done\nfi\n";
};
205FD3A1153F02AA00693E13 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\nexport UFW_MASTER_SCRIPT_RUNNING=1\n\n\n# Functions\n\n## List files in the specified directory, storing to the specified array.\n#\n# @param $1 The path to list\n# @param $2 The name of the array to fill\n#\n##\nlist_files ()\n{\n filelist=$(ls \"$1\")\n while read line\n do\n eval \"$2[\\${#$2[*]}]=\\\"\\$line\\\"\"\n done <<< \"$filelist\"\n}\n\n\n# Sanity check\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n echo \"Framework target \\\"${TARGET_NAME}\\\" had no source files to build from. Make sure your source files have the correct target membership\"\n exit 1\nfi\n\n\n# Gather information\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n UFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n\n# Short-circuit if all binaries are up to date.\n# We already checked the other platform in the prerun script.\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\n\n# Make sure the other platform gets built\n\necho \"Build other platform\"\n\necho xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n\n\n# Build the fat static library binary\n\necho \"Create universal static library\"\n\nif [[ \"$XCODE_VERSION_MAJOR\" = \"0500\" ]] || [[ \"$XCODE_VERSION_MAJOR\" = \"0600\" ]]\nthen\n echo \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$DT_TOOLCHAIN_DIR/usr/bin/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nelse\n echo \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\nfi\n\necho mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nmv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n\n\n# Build framework structure\n\necho \"Build symlinks\"\n\necho ln -sfh A \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\nln -sfh A \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Versions/Current\"\necho ln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\nln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Headers\"\necho ln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\nln -sfh Versions/Current/Resources \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Resources\"\necho ln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\nln -sfh \"Versions/Current/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${EXECUTABLE_NAME}\"\n\n\n# Link to binary for unit tests\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework\"\nln -sfh \"../${WRAPPER_NAME}/${EXECUTABLE_NAME}\" \"${BUILT_PRODUCTS_DIR}/.fake_fw_testing.framework/.fake_fw_testing\"\n\n\n# Build embedded framework structure\n\necho \"Build Embedded Framework\"\n\necho rm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\necho mkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\necho cp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\ncp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\n\ndeclare -a UFW_FILE_LIST\nlist_files \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" UFW_FILE_LIST\nfor filename in \"${UFW_FILE_LIST[@]}\"\ndo\n if [[ \"${filename}\" != \"Info.plist\" ]] && [[ ! \"${filename}\" =~ .*\\.lproj$ ]]\n then\n echo ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n fi\ndone\n\n\n# Replace other platform's framework with a copy of this one (so that both have the same universal binary)\n\necho \"Copy from $UFW_SDK_PLATFORM to $UFW_OTHER_PLATFORM\"\n\necho rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\nrm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\necho cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\ncp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n";
};
205FD3AF153F02AA00693E13 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
205FD39C153F02AA00693E13 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
205FD3D1153F02F700693E13 /* DCPropertyFinder.m in Sources */,
205FD3D6153F030800693E13 /* DCReferenceKeyParser.m in Sources */,
205FD3DB153F031C00693E13 /* DCParserConfiguration.m in Sources */,
205FD3E2153F032F00693E13 /* DCGenericConverter.m in Sources */,
205FD3ED153F033A00693E13 /* DCNSArrayConverter.m in Sources */,
205FD3EF153F033A00693E13 /* DCNSDateConverter.m in Sources */,
205FD3F1153F033A00693E13 /* DCNSURLConverter.m in Sources */,
205FD3F3153F033A00693E13 /* DCSimpleConverter.m in Sources */,
B5FD89B31851D1EC00EB816F /* NSObject+DCKeyValueObjectMapping.m in Sources */,
205FD3FC153F034D00693E13 /* DCDynamicAttribute.m in Sources */,
205FD3FE153F034D00693E13 /* DCObjectMapping.m in Sources */,
205FD400153F034D00693E13 /* DCArrayMapping.m in Sources */,
205FD404153F035700693E13 /* DCKeyValueObjectMapping.m in Sources */,
201F6F5F153F56BE009A24B9 /* DCPropertyAggregator.m in Sources */,
201F6F70153F789A009A24B9 /* DCAttributeSetter.m in Sources */,
201F6F74153F7C9E009A24B9 /* DCDictionaryRearranger.m in Sources */,
20D62C201588EF2F00484122 /* DCNSSetConverter.m in Sources */,
2077210115E3E406000A4FA3 /* DCCustomInitialize.m in Sources */,
20D0C2C215F51569001B7278 /* DCCustomParser.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
205FD3AC153F02AA00693E13 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B5FD89B51851D21600EB816F /* NSObject+DCKeyValueObjectMappingTests.m in Sources */,
205FD40D153F03F000693E13 /* Person.m in Sources */,
205FD40E153F03F000693E13 /* Tweet.m in Sources */,
205FD40F153F03F000693E13 /* User.m in Sources */,
205FD41D153F040900693E13 /* KeyValueObjectMappingTests.m in Sources */,
205FD41E153F040900693E13 /* DCDynamicAttributeTest.m in Sources */,
205FD41F153F040900693E13 /* DCPropertyFinderTests.m in Sources */,
205FD420153F040900693E13 /* DCArrayOfTweetsOnUserTests.m in Sources */,
205FD421153F040900693E13 /* DCReferenceKeyParserTests.m in Sources */,
201F6F53153F31FD009A24B9 /* DCCoverageFix.m in Sources */,
201F6F63153F632F009A24B9 /* Bus.m in Sources */,
201F6F66153F6355009A24B9 /* Location.m in Sources */,
201F6F6B153F6421009A24B9 /* DCPropertyAggregatorTests.m in Sources */,
20D62C241588F8D700484122 /* DCSerializationTests.m in Sources */,
2077210615E3F9FD000A4FA3 /* DCCustomInitializeTest.m in Sources */,
2077210915E40084000A4FA3 /* DCParserConfigurationTest.m in Sources */,
2840FF7615E827F40047AF2E /* DCNSDateConverterTests.m in Sources */,
20D0C2C915F54895001B7278 /* DCCustomParserTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
205FD3BA153F02AA00693E13 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 205FD3A2153F02AA00693E13 /* KeyValueObjectMapping */;
targetProxy = 205FD3B9153F02AA00693E13 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
205FD3BF153F02AA00693E13 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
205FD3C0153F02AA00693E13 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
205FD3C5153F02AA00693E13 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
205FD3C6153F02AA00693E13 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
205FD3C8153F02AA00693E13 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)";
DEAD_CODE_STRIPPING = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_GENERATE_TEST_COVERAGE_FILES = NO;
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "KeyValueObjectMapping/KeyValueObjectMapping-Prefix.pch";
GCC_THUMB_SUPPORT = NO;
INFOPLIST_FILE = "KeyValueObjectMapping/KeyValueObjectMapping-Info.plist";
INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist";
INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)";
LINK_WITH_STANDARD_LIBRARIES = NO;
MACH_O_TYPE = mh_object;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources";
WRAPPER_EXTENSION = framework;
};
name = Debug;
};
205FD3C9153F02AA00693E13 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONTENTS_FOLDER_PATH = "$(WRAPPER_NAME)/Versions/$(FRAMEWORK_VERSION)";
DEAD_CODE_STRIPPING = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_GENERATE_TEST_COVERAGE_FILES = NO;
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "KeyValueObjectMapping/KeyValueObjectMapping-Prefix.pch";
GCC_THUMB_SUPPORT = NO;
INFOPLIST_FILE = "KeyValueObjectMapping/KeyValueObjectMapping-Info.plist";
INFOPLIST_PATH = "$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Info.plist";
INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)";
LINK_WITH_STANDARD_LIBRARIES = NO;
MACH_O_TYPE = mh_object;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
UNLOCALIZED_RESOURCES_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Resources";
WRAPPER_EXTENSION = framework;
};
name = Release;
};
205FD3CB153F02AA00693E13 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
);
GCC_GENERATE_TEST_COVERAGE_FILES = NO;
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "KeyValueObjectMapping/KeyValueObjectMapping-Prefix.pch";
INFOPLIST_FILE = "KeyValueObjectMappingTests/KeyValueObjectMappingTests-Info.plist";
OTHER_LDFLAGS = (
"-framework",
SenTestingKit,
"-framework",
.fake_fw_testing,
);
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = octest;
};
name = Debug;
};
205FD3CC153F02AA00693E13 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
);
GCC_GENERATE_TEST_COVERAGE_FILES = NO;
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "KeyValueObjectMapping/KeyValueObjectMapping-Prefix.pch";
INFOPLIST_FILE = "KeyValueObjectMappingTests/KeyValueObjectMappingTests-Info.plist";
OTHER_LDFLAGS = (
"-framework",
SenTestingKit,
"-framework",
.fake_fw_testing,
);
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = octest;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
205FD399153F02AA00693E13 /* Build configuration list for PBXProject "KeyValueObjectMapping" */ = {
isa = XCConfigurationList;
buildConfigurations = (
205FD3C5153F02AA00693E13 /* Debug */,
205FD3C6153F02AA00693E13 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
205FD3C7153F02AA00693E13 /* Build configuration list for PBXNativeTarget "KeyValueObjectMapping" */ = {
isa = XCConfigurationList;
buildConfigurations = (
205FD3C8153F02AA00693E13 /* Debug */,
205FD3C9153F02AA00693E13 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
205FD3CA153F02AA00693E13 /* Build configuration list for PBXNativeTarget "KeyValueObjectMappingTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
205FD3CB153F02AA00693E13 /* Debug */,
205FD3CC153F02AA00693E13 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 205FD396153F02AA00693E13 /* Project object */;
}
================================================
FILE: KeyValueObjectMapping.xcodeproj/xcshareddata/xcschemes/KeyValueObjectMapping.xcscheme
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "205FD3A2153F02AA00693E13"
BuildableName = "KeyValueObjectMapping.framework"
BlueprintName = "KeyValueObjectMapping"
ReferencedContainer = "container:KeyValueObjectMapping.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "205FD3B0153F02AA00693E13"
BuildableName = "KeyValueObjectMappingTests.octest"
BlueprintName = "KeyValueObjectMappingTests"
ReferencedContainer = "container:KeyValueObjectMapping.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
================================================
FILE: KeyValueObjectMapping.xcodeproj/xcshareddata/xcschemes/KeyValueObjectMappingTests.xcscheme
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "205FD3B0153F02AA00693E13"
BuildableName = "KeyValueObjectMappingTests.octest"
BlueprintName = "KeyValueObjectMappingTests"
ReferencedContainer = "container:KeyValueObjectMapping.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
================================================
FILE: KeyValueObjectMappingTests/Bus.h
================================================
//
// Bus.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Location.h"
@interface Bus : NSObject
@property(nonatomic, readonly) NSString *name;
@property(nonatomic, readonly) Location *location;
-(id)initWithName: (NSString *)name andLocation: (Location *) location;
@end
================================================
FILE: KeyValueObjectMappingTests/Bus.m
================================================
//
// Bus.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "Bus.h"
@implementation Bus
@synthesize name, location;
-(id)initWithName: (NSString *) _name andLocation: (Location *) _location {
self = [super init];
if (self) {
name = _name;
location = _location;
}
return self;
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCArrayOfTweetsOnUserTests.h
================================================
//
// DCArrayOfTweetsOnUserTests.h
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/16/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCArrayOfTweetsOnUserTests : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCArrayOfTweetsOnUserTests.m
================================================
//
// DCArrayOfTweetsOnUserTests.m
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/16/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCArrayOfTweetsOnUserTests.h"
#import "DCKeyValueObjectMapping.h"
#import "DCArrayMapping.h"
#import "DCParserConfiguration.h"
#import "Tweet.h"
#import "User.h"
@interface DCArrayOfTweetsOnUserTests()
@property(nonatomic, strong) NSMutableDictionary *jsonParsed;
@end
@implementation DCArrayOfTweetsOnUserTests
@synthesize jsonParsed;
-(void)setUp{
[super setUp];
NSString *caminhoJson = [[NSBundle
bundleForClass: [self class]]
pathForResource:@"user"
ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:caminhoJson];
NSError *error;
jsonParsed = [NSJSONSerialization JSONObjectWithData:data
options:NSJSONReadingMutableContainers
error:&error];
}
- (void) testShouldCreateAnUserWithTweets {
DCArrayMapping *mapper = [DCArrayMapping mapperForClassElements:[Tweet class]
forAttribute:@"tweets"
onClass:[User class]];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
[configuration addArrayMapper:mapper];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[User class]
andConfiguration:configuration];
User *user = [parser parseDictionary:jsonParsed];
STAssertNotNil(user.tweets, @"Tweets should not be nil");
STAssertEquals((int)user.tweets.count, 2, @"Should have 2 tweets on array of tweets");
}
- (void) testShouldCreateUserWithNilOnTweetsArray{
DCObjectMapping *objectMapping = [DCObjectMapping mapKeyPath:@"tweets_nullable"
toAttribute:@"tweets"
onClass:[User class]];
DCArrayMapping *mapper = [DCArrayMapping mapperForClass:[Tweet class]
onMapping:objectMapping];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
[configuration addArrayMapper:mapper];
NSMutableDictionary *copy = [jsonParsed mutableCopy];
[copy removeObjectForKey:@"tweets"];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[User class]
andConfiguration:configuration];
User *user = [parser parseDictionary:copy];
STAssertEqualObjects(user.tweets, nil, @"Tweets should be nil", nil);
}
- (void) testShouldCreateUserWithEmptyTweetsOnArray{
DCObjectMapping *objectMapping = [DCObjectMapping mapKeyPath:@"tweets_empty"
toAttribute:@"tweets"
onClass:[User class]];
DCArrayMapping *mapper = [DCArrayMapping mapperForClass:[Tweet class]
onMapping:objectMapping];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
[configuration addArrayMapper:mapper];
NSMutableDictionary *copy = [jsonParsed mutableCopy];
[copy removeObjectForKey:@"tweets"];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[User class]
andConfiguration:configuration];
User *user = [parser parseDictionary:copy];
NSArray *tweets = user.tweets;
STAssertNotNil(tweets, @"Tweets should be nil");
STAssertEquals((int)[tweets count], (int)0, @"Tweets length should be 0");
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCCoverageFix.h
================================================
//
// DCCoverageFix.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* This fixes a problem related to an Apple implementation of a core unix api.
*/
@interface DCCoverageFix : NSObject
FILE* fopen$UNIX2003(const char* filename, const char* mode);
size_t fwrite$UNIX2003(const void* ptr, size_t size, size_t nitems, FILE* stream);
@end
================================================
FILE: KeyValueObjectMappingTests/DCCoverageFix.m
================================================
//
// DCCoverageFix.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCCoverageFix.h"
@implementation DCCoverageFix
FILE* fopen$UNIX2003(const char* filename, const char* mode) {
return fopen(filename, mode);
}
size_t fwrite$UNIX2003(const void* ptr, size_t size, size_t nitems, FILE* stream) {
return fwrite(ptr, size, nitems, stream);
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCCustomFormaterTests.h
================================================
//
// DCCustomFormaterTests.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 9/3/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCCustomFormaterTests : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCCustomFormaterTests.m
================================================
//
// DCCustomFormaterTests.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 9/3/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCCustomFormaterTests.h"
@implementation DCCustomFormaterTests
@end
================================================
FILE: KeyValueObjectMappingTests/DCCustomInitializeTest.h
================================================
//
// DCCustomInitializeTest.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 8/21/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCCustomInitializeTest : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCCustomInitializeTest.m
================================================
//
// DCCustomInitializeTest.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 8/21/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCCustomInitializeTest.h"
#import "DCCustomInitialize.h"
#import "Tweet.h"
#import "Person.h"
#import "DCParserConfiguration.h"
#import "DCKeyValueObjectMapping.h"
@implementation DCCustomInitializeTest
- (void)testShouldCreateAnDCCustomInitialize {
DCCustomInitializeBlock customBlock = ^(__weak Class classOfObjectToGenerate, NSDictionary *values, id parentObject) {
return [[classOfObjectToGenerate alloc] init];
};
DCCustomInitialize *customInitialize = [[DCCustomInitialize alloc] initWithBlockInitialize:customBlock forClass:[Tweet class]];
BOOL valid = [customInitialize isValidToPerformBlock:[Tweet class]];
BOOL invalid = [customInitialize isValidToPerformBlock:[Person class]];
STAssertTrue(valid, @"should be valid to perform block on a tweet class");
STAssertFalse(invalid, @"shouldn't be valid to perform block on a person class");
}
- (void)testShouldRetrieveParentObject {
NSString *jsonPath = [[NSBundle bundleForClass: [self class]] pathForResource:@"tweet" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:jsonPath];
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data
options:NSJSONReadingMutableContainers error:nil];
DCParserConfiguration *config = [DCParserConfiguration configuration];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = config.datePattern;
DCKeyValueObjectMapping * parser = [DCKeyValueObjectMapping mapperForClass:[Tweet class] andConfiguration:config];
__block Tweet *parentTweet;
DCCustomInitializeBlock customBlock = ^(__weak Class classOfObjectToGenerate, NSDictionary *values, id parentObject) {
id object = [[classOfObjectToGenerate alloc] init];
parentTweet = parentObject;
return object;
};
DCCustomInitialize *customInitialize = [[DCCustomInitialize alloc] initWithBlockInitialize:customBlock forClass:[User class]];
[config addCustomInitializersObject:customInitialize];
[parser parseDictionary:json];
NSLog(@"%@", [parentTweet idStr]);
STAssertTrue([[parentTweet idStr] isEqualToString:@"190957570511478784"], @"idStr should be 190957570511478784");
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCCustomParserTests.h
================================================
//
// DCCustomParserTests.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 9/3/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCCustomParserTests : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCCustomParserTests.m
================================================
//
// DCCustomParserTests.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 9/3/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCCustomParserTests.h"
#import "DCCustomParser.h"
#import "User.h"
#import "Tweet.h"
@implementation DCCustomParserTests
- (void) testShouldCreateAnDCCustomInitialize {
DCCustomParserBlock customBlock = ^(__weak NSDictionary *dictionary, __weak NSString *attributeName, __weak Class destinationClass, __weak id value){
return value;
};
DCCustomParser *customParser = [[DCCustomParser alloc] initWithBlockParser:customBlock
forAttributeName:@"user_name"
onDestinationClass:[User class]];
BOOL valid = [customParser isValidToPerformBlockOnAttributeName:@"user_name" forClass:[User class]];
BOOL invalid = [customParser isValidToPerformBlockOnAttributeName:@"user_name" forClass:[Tweet class]];
STAssertTrue(valid, @"should be valid to perform block on a tweet class");
STAssertFalse(invalid, @"shouldn't be valid to perform block on a person class");
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCDynamicAttributeTest.h
================================================
//
// DynamicAttributeTest.h
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/14/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCDynamicAttributeTest : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCDynamicAttributeTest.m
================================================
//
// DynamicAttributeTest.m
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/14/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "DCDynamicAttributeTest.h"
#import "DCDynamicAttribute.h"
#import "Tweet.h"
@implementation DCDynamicAttributeTest
- (void) testDynamicAttributeForPrimitiveInt {
DCDynamicAttribute *attribute = [[DCDynamicAttribute alloc] initWithAttributeDescription:@"Ti,R,N,Vage"
forKey:@"age"
onClass:[Tweet class]];
STAssertEquals(attribute.classe, [Tweet class], @"Should be the same class");
STAssertTrue([attribute isPrimitive], @"Should be a primitive attribute");
STAssertFalse([attribute isIdType], @"Should not be and id type");
STAssertFalse([attribute isValidObject], @"Should not be a valid object");
STAssertNil(attribute.objectMapping.classReference, @"Should be nil when attribute is primitive");
STAssertEqualObjects(attribute.typeName, @"i", @"Should be an integer attribute");
STAssertEqualObjects(attribute.objectMapping.attributeName, @"age", @"AttributeName should be age");
}
- (void) testDynamicAttributeForNSStringType {
DCDynamicAttribute *attribute = [[DCDynamicAttribute alloc] initWithAttributeDescription:@"T@\"NSString\",&,N,Vadress" forKey:@"adress" onClass:[Tweet class]];
STAssertEquals(attribute.classe, [Tweet class], @"Should be the same class");
STAssertFalse([attribute isPrimitive], @"Should be a class");
STAssertFalse([attribute isIdType], @"Should not be and id type");
STAssertTrue([attribute isValidObject], @"Should not be a valid object");
STAssertEquals(attribute.objectMapping.classReference, [NSString class], @"Should be NSString class");
STAssertEqualObjects(attribute.typeName, @"NSString", @"Should be a NSString attribute");
STAssertEqualObjects(attribute.objectMapping.attributeName, @"adress", @"AttributeName should be adress");
}
- (void) testDynamicAttributeForNSDateType {
DCDynamicAttribute *attribute = [[DCDynamicAttribute alloc] initWithAttributeDescription:@"T@\"NSDate\",&,N,VdataNascimento" forKey:@"dataNascimento" onClass:[Tweet class]];
STAssertEquals(attribute.classe, [Tweet class], @"Should be the same class");
STAssertFalse([attribute isPrimitive], @"Should be a class");
STAssertFalse([attribute isIdType], @"Should not be and id type");
STAssertTrue([attribute isValidObject], @"Should not be a valid object");
STAssertEquals(attribute.objectMapping.classReference, [NSDate class], @"Should be NSDate class");
STAssertEqualObjects(attribute.typeName, @"NSDate", @"Should be a NSDate attribute");
STAssertEqualObjects(attribute.objectMapping.attributeName, @"dataNascimento", @"AttributeName should be dataNascimento");
}
- (void) testDynamicAttributeForIdType {
DCDynamicAttribute *attribute = [[DCDynamicAttribute alloc] initWithAttributeDescription:@"T@,&,N,Vid" forKey:@"id" onClass:[Tweet class]];
STAssertEquals(attribute.classe, [Tweet class], @"Should be the same class");
STAssertFalse([attribute isPrimitive], @"Should be a class");
STAssertFalse([attribute isValidObject], @"Should not be a valid object");
STAssertTrue([attribute isIdType], @"Should be and id type");
STAssertNil(attribute.objectMapping.classReference, @"Should be nil when attribute is id");
STAssertNil(attribute.typeName, @"Should be null when attribut is id");
STAssertEqualObjects(attribute.objectMapping.attributeName, @"id", @"AttributeName should be id");
}
- (void) testDynamicNotSynthetizedAttribute {
DCDynamicAttribute *attribute = [[DCDynamicAttribute alloc] initWithAttributeDescription:@"T@\"NSString\",&,D,N" forKey:@"adress" onClass:[Tweet class] attributeName:@"adress"];
STAssertEquals(attribute.classe, [Tweet class], @"Should be the same class");
STAssertFalse([attribute isPrimitive], @"Should be a class");
STAssertFalse([attribute isIdType], @"Should not be and id type");
STAssertTrue([attribute isValidObject], @"Should not be a valid object");
STAssertEquals(attribute.objectMapping.classReference, [NSString class], @"Should be NSString class");
STAssertEqualObjects(attribute.typeName, @"NSString", @"Should be a NSString attribute");
STAssertEqualObjects(attribute.objectMapping.attributeName, @"adress", @"AttributeName should be adress");
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCNSDateConverterTests.h
================================================
//
// DCNSDateConverterTests.h
// KeyValueObjectMapping
//
// Created by Cristian Bica on 8/25/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCNSDateConverterTests : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCNSDateConverterTests.m
================================================
//
// DCNSDateConverterTests.m
// KeyValueObjectMapping
//
// Created by Cristian Bica on 8/25/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCNSDateConverterTests.h"
#import "DCNSDateConverter.h"
@interface DCNSDateConverter()
@property(nonatomic, strong) NSString *pattern;
- (BOOL) validDouble: (NSString *) doubleValue;
@end
@implementation DCNSDateConverterTests
- (void) testValidDouble {
DCNSDateConverter *convertor = [DCNSDateConverter dateConverterForPattern:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"];
STAssertTrue([convertor validDouble:@"10"], @"Should recognize '10' as a valid double");
STAssertTrue([convertor validDouble:@"10.0"], @"Should recognize '10.0' as a valid double");
[@[ @"Monday, April 17, 2006", @"Monday, April 17, 2006 2:22:48 PM", @"4/17/2006 2:22:48 PM", @"Mon, 17 Apr 2006 21:22:48 GMT", @"2006-04-17 21:22:48Z", @"2006-04-17T14:22:48.2698750-07:00" ]
enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
STAssertFalse([convertor validDouble:obj], [NSString stringWithFormat:@"Should not recognize '%@' as double", obj]);
}];
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCParserConfigurationTest.h
================================================
//
// DCParserConfigurationTest.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 8/21/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCParserConfigurationTest : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCParserConfigurationTest.m
================================================
//
// DCParserConfigurationTest.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 8/21/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCParserConfigurationTest.h"
#import "DCParserConfiguration.h"
#import "DCCustomInitialize.h"
#import "Tweet.h"
#import "User.h"
@implementation DCParserConfigurationTest
- (void) testCreateCustomTweetWithBlock {
DCCustomInitializeBlock block = ^id(__weak Class classToGenerate, NSDictionary *values, id parentObject){
STAssertEquals(classToGenerate, [Tweet class], @"classToGenerate should be an tweet");
Tweet *tweet = [[Tweet alloc] init];
tweet.text = @"Should be an text";
return tweet;
};
DCCustomInitialize *initializer = [[DCCustomInitialize alloc] initWithBlockInitialize:block
forClass:[Tweet class]];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
[configuration addCustomInitializersObject:initializer];
Tweet *tweet = [configuration instantiateObjectForClass:[Tweet class] withValues:nil];
STAssertTrue([tweet.text isEqualToString: @"Should be an text"], @"should have the same text passed on custom initialize");
}
- (void) testCreateObjectWithNormalInitialize {
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
Tweet *tweet = [configuration instantiateObjectForClass:[Tweet class] withValues:nil];
STAssertNotNil(tweet, @"should create an tweet when no custom initialize is used");
}
- (void) testWrongSplitTocken {
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
configuration.splitToken = @".";
STAssertFalse([configuration.splitToken isEqualToString:@"."], @"splitToken value should not have change");
configuration.nestedPrepertiesSplitToken = @"|";
configuration.splitToken = @".";
STAssertTrue([configuration.splitToken isEqualToString:@"."], @"splitToken value should have change");
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCPropertyAggregatorTests.h
================================================
//
// DCPropertyAggregatorTests.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCPropertyAggregatorTests : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCPropertyAggregatorTests.m
================================================
//
// DCPropertyAggregatorTests.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCPropertyAggregatorTests.h"
#import "DCKeyValueObjectMapping.h"
#import "DCParserConfiguration.h"
#import "DCDictionaryRearranger.h"
#import "DCPropertyAggregator.h"
#import "Bus.h"
@implementation DCPropertyAggregatorTests
- (void) testAggregateProperties {
NSString *busName = @"R. Dr. Neto De Araujo, 311";
NSNumber *latitude = [NSNumber numberWithInt:-123];
NSNumber *longitude = [NSNumber numberWithInt:-321];
NSMutableDictionary *dictionaryToParse = [[NSMutableDictionary alloc] init];
[dictionaryToParse setObject:busName forKey:@"name"];
[dictionaryToParse setObject:latitude forKey:@"latitude"];
[dictionaryToParse setObject:longitude forKey:@"longitude"];
NSSet *keys = [NSSet setWithObjects:@"latitude", @"longitude", nil];
DCPropertyAggregator *aggregator = [DCPropertyAggregator aggregateKeys:keys
intoAttribute:@"location"];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
[configuration addAggregator:aggregator];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[Bus class]
andConfiguration:configuration];
Bus *bus = [parser parseDictionary:dictionaryToParse];
STAssertNotNil(bus.location, @"Should be able to create a location using aggregator");
STAssertEqualObjects(bus.name, busName, @"Should be equals");
STAssertEqualObjects(bus.location.latitude, latitude, @"Should be equals");
STAssertEqualObjects(bus.location.longitude, longitude, @"Should be equals");
}
- (void) testAggregateMultipleRules {
NSString *busName = @"R. Dr. Neto De Araujo, 311";
NSNumber *latitude = [NSNumber numberWithInt:-123];
NSNumber *longitude = [NSNumber numberWithInt:-321];
NSNumber *distance = [NSNumber numberWithInt:100];
NSMutableDictionary *dictionaryToParse = [[NSMutableDictionary alloc] init];
[dictionaryToParse setObject:busName forKey:@"name"];
[dictionaryToParse setObject:latitude forKey:@"latitude"];
[dictionaryToParse setObject:longitude forKey:@"longitude"];
[dictionaryToParse setObject:distance forKey:@"distance"];
DCPropertyAggregator *aggregteLatLong = [DCPropertyAggregator aggregateKeys:[NSSet setWithObjects:@"latitude", @"longitude", nil] intoAttribute:@"point"];
DCPropertyAggregator *aggregatePointDist = [DCPropertyAggregator aggregateKeys:[NSSet setWithObjects:@"point", @"distance", nil] intoAttribute:@"location"];
DCParserConfiguration* configuration = [DCParserConfiguration configuration];
[configuration addAggregator:aggregteLatLong];
[configuration addAggregator:aggregatePointDist];
NSDictionary *aggregatedDict = [DCDictionaryRearranger rearrangeDictionary:dictionaryToParse forConfiguration:configuration];
STAssertNotNil(aggregatedDict, @"Should be able to create a location using aggregator");
STAssertEqualObjects([aggregatedDict objectForKey:@"name"], busName, @"Should be equals");
STAssertEqualObjects([[aggregatedDict objectForKey:@"location"] objectForKey:@"distance"], distance, @"Should be equals");
STAssertEqualObjects([[[aggregatedDict objectForKey:@"location"] objectForKey:@"point"] objectForKey:@"latitude"], latitude, @"Should be equals");
STAssertEqualObjects([[[aggregatedDict objectForKey:@"location"] objectForKey:@"point"] objectForKey:@"longitude"], longitude, @"Should be equals");
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCPropertyFinderTests.h
================================================
//
// DCPropertyFinderTests.h
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/17/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCPropertyFinderTests : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCPropertyFinderTests.m
================================================
//
// DCPropertyFinderTests.m
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/17/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCPropertyFinderTests.h"
#import "DCPropertyFinder.h"
#import "User.h"
#import "Person.h"
@interface DCPropertyFinderTests()
@property(nonatomic, strong) DCPropertyFinder *finder;
@end
@implementation DCPropertyFinderTests
@synthesize finder;
- (void)setUp {
finder = [DCPropertyFinder finderWithKeyParser:[DCReferenceKeyParser parserForToken:@"_"]];
}
- (void) testFindPropertyNameOnUser {
DCDynamicAttribute *dynamicProperty = [finder findAttributeForKey:@"name" onClass:[User class]];
STAssertNotNil(dynamicProperty, @"Should be able to find name property on User class");
STAssertEqualObjects(@"name", dynamicProperty.objectMapping.attributeName, @"Attribute name should be equals to name");
STAssertEqualObjects(@"name", dynamicProperty.objectMapping.keyReference, @"Keyreference should be equals to name");
}
- (void) testFindPropertyIdStrOnUser {
DCDynamicAttribute *dynamicProperty = [finder findAttributeForKey:@"id_str" onClass:[User class]];
STAssertNotNil(dynamicProperty, @"Should be able to find idStr property on User class");
STAssertEqualObjects(@"idStr", dynamicProperty.objectMapping.attributeName, @"Attribute should be equals to idStr");
STAssertEqualObjects(@"id_str", dynamicProperty.objectMapping.keyReference, @"Keyreference should be equals to id_str");
}
- (void) testUnknowAttributeNameForKey {
DCDynamicAttribute *dynamicProperty = [finder findAttributeForKey:@"borba" onClass:[User class]];
STAssertNil(dynamicProperty, @"Should be nill when a unknow key is passed");
}
- (void) testOverrideAttributeFinderForNameOnUser {
DCObjectMapping *mapping = [DCObjectMapping mapKeyPath:@"borba" toAttribute:@"name" onClass:[User class]];
[finder setMappers:[NSArray arrayWithObject:mapping]];
DCDynamicAttribute *dynamicProperty = [finder findAttributeForKey:@"borba" onClass:[User class]];
STAssertNotNil(dynamicProperty, @"Should be able to find name property on User class");
STAssertEqualObjects(@"name", dynamicProperty.objectMapping.attributeName, @"Attribute name should be equals to name");
STAssertEqualObjects(@"borba", dynamicProperty.objectMapping.keyReference, @"Keyreference should be equals to borba");
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCReferenceKeyParserTests.h
================================================
//
// DCReferenceKeyParserTests.h
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/17/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCReferenceKeyParserTests : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCReferenceKeyParserTests.m
================================================
//
// DCReferenceKeyParserTests.m
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/17/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCReferenceKeyParserTests.h"
#import "DCReferenceKeyParser.h"
@interface DCReferenceKeyParserTests()
@property(nonatomic, strong) DCReferenceKeyParser *parser;
@end
@implementation DCReferenceKeyParserTests
@synthesize parser;
- (void)setUp{
parser = [DCReferenceKeyParser parserForToken:@"_"];
}
- (void)testPropertyNameParserForSingleWord {
NSString *word = @"id";
NSString *splitedWord = [parser splitKeyAndMakeCamelcased:word];
STAssertEqualObjects(word, splitedWord, @"Should not change the attribute name when it's a single word");
}
- (void) testPropertyNameParserForTwoWords {
NSString *word = @"id_str";
NSString *splitedWord = [parser splitKeyAndMakeCamelcased:word];
STAssertEqualObjects(@"idStr", splitedWord, @"Should remove tokens and camelcase the expression");
}
- (void) testPropertyNameParserForThreeWords {
NSString *word = @"created_time_at";
NSString *splitedWord = [parser splitKeyAndMakeCamelcased:word];
STAssertEqualObjects(@"createdTimeAt", splitedWord, @"Should remove tokens and camelcase the expression");
}
- (void) testPropertyNameParserForNilOrEmptyWord {
NSString *nilWord = nil;
NSString *emptyWord = @"";
NSString *nilWordSplited = [parser splitKeyAndMakeCamelcased:nilWord];
NSString *emptyWordSplited = [parser splitKeyAndMakeCamelcased:emptyWord];
STAssertEqualObjects(@"", nilWordSplited, @"Should be empty NSString when the property name passed is nil");
STAssertEqualObjects(@"", emptyWordSplited, @"Should be empty NSString when the property name passed is an empty NSString");
}
- (void) testWithEmptyToken {
//this happen when you try parse witout config object and property doesn't exist.
/* example
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass: [SomeClass class] andConfiguration:nil];
*/
parser = [DCReferenceKeyParser parserForToken:nil];
NSString *NotExistingProperty = @"id";
STAssertNoThrow([parser splitKeyAndMakeCamelcased:NotExistingProperty], @"shouldn't throw an exception");
}
@end
================================================
FILE: KeyValueObjectMappingTests/DCSerializationTests.h
================================================
//
// DCSerializationTests.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 6/13/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface DCSerializationTests : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/DCSerializationTests.m
================================================
//
// DCSerializationTests.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 6/13/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCSerializationTests.h"
#import "DCKeyValueObjectMapping.h"
#import "DCObjectMapping.h"
#import "DCParserConfiguration.h"
#import "Bus.h"
@interface DCSerializationTests()
@property(nonatomic, strong) DCKeyValueObjectMapping *parser;
@end
@implementation DCSerializationTests
@synthesize parser;
-(void)setUp {
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
DCObjectMapping *nameMapper = [DCObjectMapping mapKeyPath:@"name" toAttribute:@"name" onClass:[Bus class]];
[configuration addObjectMapping:nameMapper];
parser = [DCKeyValueObjectMapping mapperForClass:[Bus class] andConfiguration:configuration];
}
- (void)testSimpleFieldSerialization {
Location *localizacao = [[Location alloc] initWithLatitude:[NSNumber numberWithInt:10] andLongitude:[NSNumber numberWithInt:20]];
Bus *bus = [[Bus alloc] initWithName:@"Vila carrão" andLocation:localizacao];
NSDictionary *busParsed = [parser serializeObject:bus];
STAssertTrue([[busParsed objectForKey:@"name"] isEqualToString:@"Vila carrão"], nil);
STAssertTrue([[busParsed objectForKey:@"name"] isEqualToString:@"Vila carrão"], nil);
}
- (void)testSimpleFieldSerializationUsingAddMapper {
// build localParser
DCParserConfiguration *configutaionUsingAddMapper = [DCParserConfiguration configuration];
DCObjectMapping *nameMapper = [DCObjectMapping mapKeyPath:@"name" toAttribute:@"name" onClass:[Bus class]];
[configutaionUsingAddMapper addMapper:nameMapper];
DCKeyValueObjectMapping *localParser = [DCKeyValueObjectMapping mapperForClass:[Bus class] andConfiguration:configutaionUsingAddMapper];
// serialize it
Location *localizacao = [[Location alloc] initWithLatitude:[NSNumber numberWithInt:10] andLongitude:[NSNumber numberWithInt:20]];
Bus *bus = [[Bus alloc] initWithName:@"Vila carrão" andLocation:localizacao];
NSDictionary *busParsed = [localParser serializeObject:bus];
STAssertTrue([[busParsed objectForKey:@"name"] isEqualToString:@"Vila carrão"], nil);
STAssertTrue([[busParsed objectForKey:@"name"] isEqualToString:@"Vila carrão"], nil);
}
- (void)testInvalidAddMapperSerialization {
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
DCObjectMapping *nameMapper = [DCObjectMapping mapKeyPath:@"name" toAttribute:@"name" onClass:[Bus class]];
STAssertNoThrow([configuration addMapper:nameMapper], @"correct use of AddMapper should not throw exception");
STAssertThrowsSpecificNamed([configuration addMapper:[NSObject new]],
NSException,
NSInternalInconsistencyException,
@"incorrect use of AddMapper: should throw NSInternalInconsistencyException");
}
@end
================================================
FILE: KeyValueObjectMappingTests/KeyValueObjectMappingTests-Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>br.com.dchohfi.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
================================================
FILE: KeyValueObjectMappingTests/KeyValueObjectMappingTests.h
================================================
//
// DCKeyValueObjectMappingTests.h
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface KeyValueObjectMappingTests : SenTestCase
@end
================================================
FILE: KeyValueObjectMappingTests/KeyValueObjectMappingTests.m
================================================
//
// DCKeyValueObjectMappingTests.m
// DCKeyValueObjectMappingTests
//
// Created by Diego Chohfi on 4/13/12.
// Copyright (c) 2012 None. All rights reserved.
//
#import "KeyValueObjectMappingTests.h"
#import "DCParserConfiguration.h"
#import "DCKeyValueObjectMapping.h"
#import "DCArrayMapping.h"
#import "DCCustomInitialize.h"
#import "DCCustomParser.h"
#import "Person.h"
#import "Tweet.h"
#import "User.h"
@interface KeyValueObjectMappingTests()
@property(nonatomic,strong) NSDictionary *plist;
@property(nonatomic,strong) NSDictionary *json;
@end
@implementation KeyValueObjectMappingTests
@synthesize plist, json;
- (void)setUp
{
[super setUp];
NSString *pathToFile = [[NSBundle bundleForClass: [self class]] pathForResource:@"plist" ofType:@"plist"];
plist = [NSDictionary dictionaryWithContentsOfFile:pathToFile];
NSString *caminhoJson = [[NSBundle bundleForClass: [self class]] pathForResource:@"tweet" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:caminhoJson];
json = [NSJSONSerialization JSONObjectWithData:data
options:NSJSONReadingMutableContainers error:nil];
}
- (void) testValidPlistToPerson
{
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
configuration.datePattern = @"yyyy-MM-dd'T'hh:mm:ssZ";
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[Person class] andConfiguration:configuration];
Person *person = [parser parseDictionary:plist];
STAssertEqualObjects(person.name, @"Diego Chohfi Turini", @"Should be equals name");
STAssertEqualObjects(person.adress, @"Rua dos bobos, n 0", @"Should be equals adress");
STAssertEqualObjects(person.phone, @"+551199999999", @"Should be equals phone");
STAssertEquals(person.age, 24, nil, @"Should be equals age");
STAssertEqualObjects(person.birthDay, [NSDate dateWithTimeIntervalSince1970:565927200], nil, @"Should be equals NSDate");
STAssertNotNil(person.parents, @"Should be able to parse NSArray");
STAssertTrue(person.valid, @"Person should be valid");
STAssertEqualObjects(person.url, [NSURL URLWithString:@"http://dchohfi.com/"], @"Should create equals urls");
STAssertEqualObjects(person.nota, [NSNumber numberWithInt:10], @"Should be equals");
STAssertEqualObjects(person.dateWithString, [NSDate dateWithTimeIntervalSince1970:0], @"Should create equals NSDate");
STAssertEquals((int)[person.arrayPrimitive count], 4, @"Should have same size");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:0], @"hello", @"Should have hello on first position of array");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:1], @"mutchaco", @"Should have muthaco on first position of array");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:2], [NSNumber numberWithInt:1], @"Should have muthaco on first position of array");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:3], [NSNumber numberWithDouble:3.1416], @"Should have muthaco on first position of array");
configuration = nil;
}
-(void) testValidJsonToTweet {
DCParserConfiguration *config = [DCParserConfiguration configuration];
config.datePattern = @"eee MMM dd HH:mm:ss ZZZZ yyyy";
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = config.datePattern;
NSDate *data = [formatter dateFromString:@"Sat Apr 14 00:20:07 +0000 2012"];
DCKeyValueObjectMapping * parser = [DCKeyValueObjectMapping mapperForClass:[Tweet class] andConfiguration:config];
Tweet *tweet = [parser parseDictionary:json];
STAssertEqualObjects(tweet.idStr, @"190957570511478784", @"Should have same idStr");
STAssertEqualObjects(tweet.text, @"@pedroh96 cara, comecei uma lib pra iOS, se puder dar uma olhada e/ou contribuir :D KeyValue Parse for Objective-C https://t.co/NWMMc60v", @"Should have same text");
STAssertEqualObjects(tweet.source, @"<a href=\"http://www.osfoora.com/mac\" rel=\"nofollow\">Osfoora for Mac</a>", @"Should have same source");
STAssertNil(tweet.inReplyToStatusIdStr, @"inRepryToStatusIdStr should be null");
STAssertTrue([tweet.retweetCount isEqualToNumber:@(0)], @"RetweetCount should be equals to 0");
STAssertFalse(tweet.favorited, @"favorited should be false");
STAssertFalse(tweet.retweeted, @"favorited should be false");
STAssertEqualObjects(tweet.createdAt, data, @"CreatedAt should be equals");
data = [formatter dateFromString:@"Tue Mar 31 18:01:12 +0000 2009"];
User *user = tweet.user;
STAssertEqualObjects(user.idStr, @"27924446", @"Should have same idStr for user");
STAssertEqualObjects(user.name, @"Diego Chohfi", @"Should have same user name");
STAssertEqualObjects(user.screenName, @"dchohfi", @"Should have same user screenName");
STAssertEqualObjects(user.location, @"São Paulo", @"Should have same user location");
STAssertEqualObjects(user.description, @"Instrutor na @Caelum, desenvolvedor de coração, apaixonado por música e cerveja, sempre cerveja.", @"Should have same user description");
STAssertEqualObjects(user.url, [NSURL URLWithString:@"http://about.me/dchohfi"], @"Should have same user url");
STAssertFalse(user.protected, @"User should be protected");
STAssertEquals(user.followersCount, (long)380, @"Should have 380 followersCount");
STAssertEquals(user.friendsCount, (long)183, @"Should have 183 friendsCount");
STAssertEqualObjects(user.createdAt, data, @"Should have same createdAt date");
}
- (void) testValidJsonToArrayOfTweets{
Class tweetClass = [Tweet class];
NSArray *arrayTweets = [NSArray arrayWithObjects:json, json, json, nil];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
configuration.datePattern = @"eee MMM dd HH:mm:ss ZZZZ yyyy";
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:tweetClass andConfiguration:configuration];
NSArray *parsedArray = [parser parseArray:arrayTweets];
STAssertEquals((int)[parsedArray count], 3, @"Should have same size of tweets");
STAssertTrue([parsedArray isKindOfClass:[NSArray class]], @"Should be a NSArray");
STAssertFalse([parsedArray isKindOfClass:[NSMutableArray class]], @"Should not be a NSMutableArray");
[parsedArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
STAssertEquals(tweetClass, [obj class], @"Should be a Tweet");
}];
}
- (void) testValidJsonToUserWithMultipleTweetsAsProperty{
Class tweetClass = [Tweet class];
NSMutableDictionary *userDictionary = [NSMutableDictionary dictionaryWithDictionary:[json objectForKey:@"user"]];
NSArray *tweetsForUser = [NSArray arrayWithObjects:json, json, nil];
[userDictionary setObject:tweetsForUser forKey:@"tweets"];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
configuration.datePattern = @"eee MMM dd HH:mm:ss ZZZZ yyyy";
[configuration addArrayMapper:[DCArrayMapping mapperForClassElements:[Tweet class]
forAttribute:@"tweets"
onClass:[User class]]];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[User class]
andConfiguration:configuration];
User *user = [parser parseDictionary:userDictionary];
STAssertEquals((int)[user.tweets count], 2, @"Should have same Tweets array size");
[user.tweets enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
STAssertEquals(tweetClass, [obj class], @"Should be a Tweet");
Tweet *tweet = (Tweet *) obj;
STAssertNotNil(tweet.user, @"Should contain user on Tweet");
}];
}
- (void) testObjectMappingForNameAttribute {
NSMutableDictionary *userDictionary = [NSMutableDictionary dictionaryWithDictionary:[json objectForKey:@"user"]];
NSString *name = [userDictionary objectForKey:@"name"];
[userDictionary removeObjectForKey:@"name"];
[userDictionary setObject:name forKey:@"borba"];
DCObjectMapping *mapping = [DCObjectMapping mapKeyPath:@"borba" toAttribute:@"name" onClass:[User class]];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
[configuration addObjectMapping:mapping];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[User class] andConfiguration:configuration];
User *user = [parser parseDictionary:userDictionary];
STAssertEqualObjects(name, user.name, @"Should be able to use value on borba key and set it to user name property");
}
- (void) testNullValuesPassed
{
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[Person class]];
Person *person = [parser parseDictionary:nil];
STAssertNil(person, @"Should be nill when dictionary is nil");
NSArray *persons = [parser parseArray:nil];
STAssertNil(persons, @"Should be nill when array is nil");
parser = [DCKeyValueObjectMapping mapperForClass:nil];
person = [parser parseDictionary:[NSDictionary dictionary]];
STAssertNil(person, @"Should be nill when class is nil");
persons = [parser parseArray:[NSArray array]];
STAssertNotNil(persons, @"Should not be when class is nil");
STAssertEquals((int)[persons count], 0, @"Should return empty array when class is nil");
}
-(void) testShouldUseCustomInitializeForPropertyClasses {
NSString *customText = @"custom text to be on attribute";
DCCustomInitializeBlock block = ^id(__weak Class classToGenerate, __weak NSDictionary *values, id parentObject){
STAssertEquals(classToGenerate, [User class], @"classToGenerate should be a user");
STAssertEqualObjects([values objectForKey:@"name"], @"Diego Chohfi", @"Should have same user name");
User *user = [[classToGenerate alloc] init];
user.customText = customText;
return user;
};
DCCustomInitialize *customInitialize = [[DCCustomInitialize alloc] initWithBlockInitialize:block
forClass:[User class]];
DCParserConfiguration *config = [DCParserConfiguration configuration];
[config addCustomInitializersObject:customInitialize];
DCKeyValueObjectMapping * parser = [DCKeyValueObjectMapping mapperForClass:[Tweet class] andConfiguration:config];
Tweet *tweet = [parser parseDictionary:json];
User *user = tweet.user;
STAssertEqualObjects(customText, user.customText, @"should be equals to customText");
}
- (void) testShouldUseBlocksToParseValues {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"dd/MM/yyyy"];
DCCustomParserBlock parserBlock = ^id(NSDictionary *dictionary, NSString *__weak attributeName, __weak Class destinationClass, __weak id value) {
STAssertTrue([@"08/12/1987" isEqualToString:value], @"The value inside the block should be equals to the value on the source");
STAssertTrue([@"data" isEqualToString:attributeName], @"The attribute should be the same that is mapped for");
STAssertEquals(destinationClass, [Tweet class], @"The destionation class should be the same that is mapped for");
return [dateFormatter dateFromString:value];
};
DCCustomParser *customParser = [[DCCustomParser alloc] initWithBlockParser:parserBlock
forAttributeName:@"data"
onDestinationClass:[Tweet class]];
DCParserConfiguration *config = [DCParserConfiguration configuration];
[config addCustomParsersObject:customParser];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[Tweet class]
andConfiguration:config];
Tweet *tweet = [parser parseDictionary:json];
STAssertTrue([tweet.data isEqualToDate:[dateFormatter dateFromString:@"08/12/1987"]], nil);
}
-(void) testCustomMap {
NSMutableDictionary *tweet1 = [NSMutableDictionary dictionary];
[tweet1 setValue:@"First Value" forKey:@"property"];
[tweet1 setValue:@"Frist Tweet" forKey:@"text"];
NSMutableDictionary *tweet2 = [NSMutableDictionary dictionary];
[tweet2 setValue:@"Second Value" forKey:@"title"];
[tweet2 setValue:@"Second Tweet" forKey:@"text"];
NSMutableDictionary *userValues = [NSMutableDictionary dictionary];
[userValues setValue:@"Diego" forKey:@"name"];
[userValues setValue:[NSArray arrayWithObjects:tweet1, tweet2, nil] forKey:@"tweets"];
DCArrayMapping *arrayMapper = [DCArrayMapping mapperForClassElements:[Tweet class]
forAttribute:@"tweets"
onClass:[User class]];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
[configuration addArrayMapper:arrayMapper];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[User class]
andConfiguration:configuration];
User *user = [parser parseDictionary:userValues];
STAssertEqualObjects(@"Diego", [user name], @"");
STAssertEquals(2, (int)[user.tweets count], @"Should have two tweet");
}
- (void)testNestedProperties{
NSDictionary *source = @{@"idStr" : @"12345" , @"tweet" : @{@"text" : @"Some text"}};
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
DCObjectMapping *nestedMapping = [DCObjectMapping mapKeyPath:@"tweet.text" toAttribute:@"text" onClass:[Tweet class]];
[configuration addObjectMapping:nestedMapping];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[Tweet class] andConfiguration:configuration];
Tweet *tweet = [parser parseDictionary:source];
STAssertEqualObjects(tweet.idStr, @"12345", @"wrong id string");
STAssertEqualObjects(tweet.text, @"Some text", @"wrong text string");
}
- (void)testDeeplyNestedProperties{
NSDictionary *source = @{@"idStr" : @"12345" , @"tweet" : @{@"key1" : @{@"key2" : @{@"text" : @"Some text"}}}};
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
DCObjectMapping *nestedMapping = [DCObjectMapping mapKeyPath:@"tweet.key1.key2.text" toAttribute:@"text" onClass:[Tweet class]];
[configuration addObjectMapping:nestedMapping];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[Tweet class] andConfiguration:configuration];
Tweet *tweet = [parser parseDictionary:source];
STAssertEqualObjects(tweet.idStr, @"12345", @"wrong id string");
STAssertEqualObjects(tweet.text, @"Some text", @"wrong text string");
}
- (void)testObjectUpdateWithDictionary{
NSDictionary *source = @{@"idStr" : @"12345", @"text" : @"Text 1"};
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[Tweet class]];
Tweet *tweet = [parser parseDictionary:source];
NSDictionary *newSource = @{@"idStr" : @"67890", @"text" : @"New Text"};
[parser updateObject:tweet withDictionary:newSource];
STAssertEqualObjects(tweet.idStr, @"67890", @"wrong id string");
STAssertEqualObjects(tweet.text, @"New Text", @"wrong text string");
}
- (void)textObjectUpdateWithNestedDictionary{
NSDictionary *source = @{@"idStr" : @"12345", @"tweet" : @{@"text" : @"Text 1"}};
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
DCObjectMapping *nestedMapping = [DCObjectMapping mapKeyPath:@"tweet.text" toAttribute:@"text" onClass:[Tweet class]];
[configuration addObjectMapping:nestedMapping];
DCKeyValueObjectMapping *parser = [DCKeyValueObjectMapping mapperForClass:[Tweet class] andConfiguration:configuration];
Tweet *tweet = [parser parseDictionary:source];
NSDictionary *newSource = @{@"idStr" : @"67890", @"tweet" : @{@"text" : @"New Text"}};
[parser updateObject:tweet withDictionary:newSource];
STAssertEqualObjects(tweet.idStr, @"67890", @"wrong id string");
STAssertEqualObjects(tweet.text, @"New Text", @"wrong text string");
}
@end
================================================
FILE: KeyValueObjectMappingTests/Location.h
================================================
//
// Location.h
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Location : NSObject
@property(nonatomic, readonly) NSNumber *latitude;
@property(nonatomic, readonly) NSNumber *longitude;
-(id)initWithLatitude: (NSNumber *) latitude andLongitude: (NSNumber *) longitude;
@end
================================================
FILE: KeyValueObjectMappingTests/Location.m
================================================
//
// Location.m
// KeyValueObjectMapping
//
// Created by Diego Chohfi on 4/18/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "Location.h"
@implementation Location
@synthesize latitude, longitude;
-(id)initWithLatitude: (NSNumber *) _latitude andLongitude: (NSNumber *) _longitude {
self = [super init];
if (self) {
latitude = _latitude;
longitude = _longitude;
}
return self;
}
@end
================================================
FILE: KeyValueObjectMappingTests/NSObject+DCKeyValueObjectMappingTests.m
================================================
//
// NSObject+DCKeyValueObjectMappingTests.m
// KeyValueObjectMapping
//
// Created by Benjamin Petit on 06/12/2013.
// Copyright (c) 2013 dchohfi. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
#import "NSObject+DCKeyValueObjectMapping.h"
#import "DCArrayMapping.h"
#import "DCCustomInitialize.h"
#import "DCCustomParser.h"
#import "Person.h"
#import "Tweet.h"
#import "User.h"
@interface NSObject_DCKeyValueObjectMappingTests : SenTestCase
@property(nonatomic,strong) NSDictionary *plist;
@property(nonatomic,strong) NSDictionary *json;
@end
@implementation NSObject_DCKeyValueObjectMappingTests
@synthesize plist, json;
- (void)setUp
{
[super setUp];
// Put setup code here; it will be run once, before the first test case.
NSString *pathToFile = [[NSBundle bundleForClass: [self class]] pathForResource:@"plist" ofType:@"plist"];
plist = [NSDictionary dictionaryWithContentsOfFile:pathToFile];
NSString *caminhoJson = [[NSBundle bundleForClass: [self class]] pathForResource:@"tweet" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:caminhoJson];
json = [NSJSONSerialization JSONObjectWithData:data
options:NSJSONReadingMutableContainers error:nil];
}
- (void)testValidPlistToPerson
{
Person *person = [Person dc_parseDictionary:plist];
STAssertEqualObjects(person.name, @"Diego Chohfi Turini", @"Should be equals name");
STAssertEqualObjects(person.adress, @"Rua dos bobos, n 0", @"Should be equals adress");
STAssertEqualObjects(person.phone, @"+551199999999", @"Should be equals phone");
STAssertEquals(person.age, 24, nil, @"Should be equals age");
STAssertNotNil(person.parents, @"Should be able to parse NSArray");
STAssertTrue(person.valid, @"Person should be valid");
STAssertEqualObjects(person.url, [NSURL URLWithString:@"http://dchohfi.com/"], @"Should create equals urls");
STAssertEqualObjects(person.nota, [NSNumber numberWithInt:10], @"Should be equals");
STAssertEquals((int)[person.arrayPrimitive count], 4, @"Should have same size");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:0], @"hello", @"Should have hello on first position of array");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:1], @"mutchaco", @"Should have muthaco on first position of array");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:2], [NSNumber numberWithInt:1], @"Should have muthaco on first position of array");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:3], [NSNumber numberWithDouble:3.1416], @"Should have muthaco on first position of array");
}
- (void) testValidPlistToPersonWithConfiguration
{
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
configuration.datePattern = @"yyyy-MM-dd'T'hh:mm:ssZ";
Person *person = [Person dc_parseDictionary:plist configuration:configuration];
STAssertEqualObjects(person.name, @"Diego Chohfi Turini", @"Should be equals name");
STAssertEqualObjects(person.adress, @"Rua dos bobos, n 0", @"Should be equals adress");
STAssertEqualObjects(person.phone, @"+551199999999", @"Should be equals phone");
STAssertEquals(person.age, 24, nil, @"Should be equals age");
STAssertEqualObjects(person.birthDay, [NSDate dateWithTimeIntervalSince1970:565927200], nil, @"Should be equals NSDate");
STAssertNotNil(person.parents, @"Should be able to parse NSArray");
STAssertTrue(person.valid, @"Person should be valid");
STAssertEqualObjects(person.url, [NSURL URLWithString:@"http://dchohfi.com/"], @"Should create equals urls");
STAssertEqualObjects(person.nota, [NSNumber numberWithInt:10], @"Should be equals");
STAssertEqualObjects(person.dateWithString, [NSDate dateWithTimeIntervalSince1970:0], @"Should create equals NSDate");
STAssertEquals((int)[person.arrayPrimitive count], 4, @"Should have same size");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:0], @"hello", @"Should have hello on first position of array");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:1], @"mutchaco", @"Should have muthaco on first position of array");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:2], [NSNumber numberWithInt:1], @"Should have muthaco on first position of array");
STAssertEqualObjects([person.arrayPrimitive objectAtIndex:3], [NSNumber numberWithDouble:3.1416], @"Should have muthaco on first position of array");
configuration = nil;
}
-(void) testValidJsonToTweet {
DCParserConfiguration *config = [DCParserConfiguration configuration];
config.datePattern = @"eee MMM dd HH:mm:ss ZZZZ yyyy";
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = config.datePattern;
NSDate *data = [formatter dateFromString:@"Sat Apr 14 00:20:07 +0000 2012"];
Tweet *tweet = [Tweet dc_parseDictionary:json configuration:config];
STAssertEqualObjects(tweet.idStr, @"190957570511478784", @"Should have same idStr");
STAssertEqualObjects(tweet.text, @"@pedroh96 cara, comecei uma lib pra iOS, se puder dar uma olhada e/ou contribuir :D KeyValue Parse for Objective-C https://t.co/NWMMc60v", @"Should have same text");
STAssertEqualObjects(tweet.source, @"<a href=\"http://www.osfoora.com/mac\" rel=\"nofollow\">Osfoora for Mac</a>", @"Should have same source");
STAssertNil(tweet.inReplyToStatusIdStr, @"inRepryToStatusIdStr should be null");
STAssertTrue([tweet.retweetCount isEqualToNumber:@(0)], @"RetweetCount should be equals to 0");
STAssertFalse(tweet.favorited, @"favorited should be false");
STAssertFalse(tweet.retweeted, @"favorited should be false");
STAssertEqualObjects(tweet.createdAt, data, @"CreatedAt should be equals");
data = [formatter dateFromString:@"Tue Mar 31 18:01:12 +0000 2009"];
User *user = tweet.user;
STAssertEqualObjects(user.idStr, @"27924446", @"Should have same idStr for user");
STAssertEqualObjects(user.name, @"Diego Chohfi", @"Should have same user name");
STAssertEqualObjects(user.screenName, @"dchohfi", @"Should have same user screenName");
STAssertEqualObjects(user.location, @"São Paulo", @"Should have same user location");
STAssertEqualObjects(user.description, @"Instrutor na @Caelum, desenvolvedor de coração, apaixonado por música e cerveja, sempre cerveja.", @"Should have same user description");
STAssertEqualObjects(user.url, [NSURL URLWithString:@"http://about.me/dchohfi"], @"Should have same user url");
STAssertFalse(user.protected, @"User should be protected");
STAssertEquals(user.followersCount, (long)380, @"Should have 380 followersCount");
STAssertEquals(user.friendsCount, (long)183, @"Should have 183 friendsCount");
STAssertEqualObjects(user.createdAt, data, @"Should have same createdAt date");
}
- (void) testValidJsonToArrayOfTweets{
Class tweetClass = [Tweet class];
NSArray *arrayTweets = [NSArray arrayWithObjects:json, json, json, nil];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
configuration.datePattern = @"eee MMM dd HH:mm:ss ZZZZ yyyy";
NSArray *parsedArray = [Tweet dc_parseArray:arrayTweets configuration:configuration];
STAssertEquals((int)[parsedArray count], 3, @"Should have same size of tweets");
STAssertTrue([parsedArray isKindOfClass:[NSArray class]], @"Should be a NSArray");
STAssertFalse([parsedArray isKindOfClass:[NSMutableArray class]], @"Should not be a NSMutableArray");
[parsedArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
STAssertEquals(tweetClass, [obj class], @"Should be a Tweet");
}];
}
- (void) testValidJsonToUserWithMultipleTweetsAsProperty{
Class tweetClass = [Tweet class];
NSMutableDictionary *userDictionary = [NSMutableDictionary dictionaryWithDictionary:[json objectForKey:@"user"]];
NSArray *tweetsForUser = [NSArray arrayWithObjects:json, json, nil];
[userDictionary setObject:tweetsForUser forKey:@"tweets"];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
configuration.datePattern = @"eee MMM dd HH:mm:ss ZZZZ yyyy";
[configuration addArrayMapper:[DCArrayMapping mapperForClassElements:[Tweet class]
forAttribute:@"tweets"
onClass:[User class]]];
User *user = [User dc_parseDictionary:userDictionary configuration:configuration];
STAssertEquals((int)[user.tweets count], 2, @"Should have same Tweets array size");
[user.tweets enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
STAssertEquals(tweetClass, [obj class], @"Should be a Tweet");
Tweet *tweet = (Tweet *) obj;
STAssertNotNil(tweet.user, @"Should contain user on Tweet");
}];
}
- (void) testObjectMappingForNameAttribute {
NSMutableDictionary *userDictionary = [NSMutableDictionary dictionaryWithDictionary:[json objectForKey:@"user"]];
NSString *name = [userDictionary objectForKey:@"name"];
[userDictionary removeObjectForKey:@"name"];
[userDictionary setObject:name forKey:@"borba"];
DCObjectMapping *mapping = [DCObjectMapping mapKeyPath:@"borba" toAttribute:@"name" onClass:[User class]];
DCParserConfiguration *configuration = [DCParserConfiguration configuration];
[configuration addObjectMapping:mapping];
User *user = [User dc_parseDictionary:userDictionary configuration:configuration];
STAssertEqualObjects(name, user.name, @"Should be able to use value on borba key and set it to user name property");
}
- (void) testNullValuesPassed
{
Person *person = [Person dc_parseDictionary:nil];
STAssertNil(person, @"Should be nill when dictionary is nil");
NSArray *persons = [Person dc_parseArray:nil];
STAssertNil(persons, @"Should be nill when array is nil");
}
-(void) testShouldUseCustomInitializeForPropertyClasses {
NSString *customText = @"custom text to be on attribute";
DCCustomInitializeBlock block = ^id(__weak Class classToGenerate, __weak NSDictionary *values, id parentObject){
STAssertEquals(classToGenerate, [User class], @"classToGenerate should be a user");
STAssertEqualObjects([values objectForKey:@"name"], @"Diego Chohfi", @"Should have same user name");
User *user = [[classToGenerate alloc] init];
user.customText = customText;
return user;
};
DCCustomInitialize *customInitialize = [[DCCustomInitialize alloc] initWithBlockInitialize:block
forClass:[User class]];
DCParserConfiguration *config = [DCParserConfiguration configuration];
[config addCustomInitializersObject:customInitialize];
Tweet *tweet = [Tweet dc_parseDictionary:json configuration:config];
User *user = tweet.user;
STAssertEqualObjects(customText, user.customText, @"should be equals to customText");
}
- (void) testShouldUseBlocksToParseValues {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"dd/MM/yyyy"];
DCCustomParserBlock parserBlock = ^id(NSDictionary *dictionary, NSString *__weak attributeName, __weak Class destinationClass, __weak id value) {
STAssertTrue([@"08/12/1987" isEqualToString:value], @"The value inside the block should be equal
gitextract_xqg0idnf/ ├── .gitignore ├── DCKeyValueObjectMapping.podspec ├── KeyValueObjectMapping/ │ ├── DCArrayMapping.h │ ├── DCArrayMapping.m │ ├── DCAttributeSetter.h │ ├── DCAttributeSetter.m │ ├── DCCustomInitialize.h │ ├── DCCustomInitialize.m │ ├── DCCustomParser.h │ ├── DCCustomParser.m │ ├── DCDictionaryRearranger.h │ ├── DCDictionaryRearranger.m │ ├── DCDynamicAttribute.h │ ├── DCDynamicAttribute.m │ ├── DCGenericConverter.h │ ├── DCGenericConverter.m │ ├── DCKeyValueObjectMapping.h │ ├── DCKeyValueObjectMapping.m │ ├── DCMapping.h │ ├── DCNSArrayConverter.h │ ├── DCNSArrayConverter.m │ ├── DCNSDateConverter.h │ ├── DCNSDateConverter.m │ ├── DCNSSetConverter.h │ ├── DCNSSetConverter.m │ ├── DCNSURLConverter.h │ ├── DCNSURLConverter.m │ ├── DCObjectMapping.h │ ├── DCObjectMapping.m │ ├── DCParserConfiguration.h │ ├── DCParserConfiguration.m │ ├── DCPropertyAggregator.h │ ├── DCPropertyAggregator.m │ ├── DCPropertyFinder.h │ ├── DCPropertyFinder.m │ ├── DCReferenceKeyParser.h │ ├── DCReferenceKeyParser.m │ ├── DCSimpleConverter.h │ ├── DCSimpleConverter.m │ ├── DCValueConverter.h │ ├── KeyValueObjectMapping-Info.plist │ ├── KeyValueObjectMapping-Prefix.pch │ ├── NSObject+DCKeyValueObjectMapping.h │ └── NSObject+DCKeyValueObjectMapping.m ├── KeyValueObjectMapping.xcodeproj/ │ ├── project.pbxproj │ └── xcshareddata/ │ └── xcschemes/ │ ├── KeyValueObjectMapping.xcscheme │ └── KeyValueObjectMappingTests.xcscheme ├── KeyValueObjectMappingTests/ │ ├── Bus.h │ ├── Bus.m │ ├── DCArrayOfTweetsOnUserTests.h │ ├── DCArrayOfTweetsOnUserTests.m │ ├── DCCoverageFix.h │ ├── DCCoverageFix.m │ ├── DCCustomFormaterTests.h │ ├── DCCustomFormaterTests.m │ ├── DCCustomInitializeTest.h │ ├── DCCustomInitializeTest.m │ ├── DCCustomParserTests.h │ ├── DCCustomParserTests.m │ ├── DCDynamicAttributeTest.h │ ├── DCDynamicAttributeTest.m │ ├── DCNSDateConverterTests.h │ ├── DCNSDateConverterTests.m │ ├── DCParserConfigurationTest.h │ ├── DCParserConfigurationTest.m │ ├── DCPropertyAggregatorTests.h │ ├── DCPropertyAggregatorTests.m │ ├── DCPropertyFinderTests.h │ ├── DCPropertyFinderTests.m │ ├── DCReferenceKeyParserTests.h │ ├── DCReferenceKeyParserTests.m │ ├── DCSerializationTests.h │ ├── DCSerializationTests.m │ ├── KeyValueObjectMappingTests-Info.plist │ ├── KeyValueObjectMappingTests.h │ ├── KeyValueObjectMappingTests.m │ ├── Location.h │ ├── Location.m │ ├── NSObject+DCKeyValueObjectMappingTests.m │ ├── Person.h │ ├── Person.m │ ├── Tweet.h │ ├── Tweet.m │ ├── User.h │ ├── User.m │ ├── en.lproj/ │ │ └── InfoPlist.strings │ ├── plist.plist │ ├── tweet.json │ └── user.json ├── LICENSE └── README.md
Condensed preview — 91 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (233K chars).
[
{
"path": ".gitignore",
"chars": 222,
"preview": "# Xcode\nbuild/*\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!defaul"
},
{
"path": "DCKeyValueObjectMapping.podspec",
"chars": 617,
"preview": "Pod::Spec.new do |s|\n s.name = \"DCKeyValueObjectMapping\"\n s.version = \"1.5\"\n s.summary = \"Automatic"
},
{
"path": "KeyValueObjectMapping/DCArrayMapping.h",
"chars": 757,
"preview": "//\n// DCArrayMapping.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/16/12.\n// Copyright (c) 2012 dc"
},
{
"path": "KeyValueObjectMapping/DCArrayMapping.m",
"chars": 1504,
"preview": "//\n// DCArrayMapping.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/16/12.\n// Copyright (c) 2012 dc"
},
{
"path": "KeyValueObjectMapping/DCAttributeSetter.h",
"chars": 389,
"preview": "//\n// DCAttributeSetter.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2012 d"
},
{
"path": "KeyValueObjectMapping/DCAttributeSetter.m",
"chars": 940,
"preview": "//\n// DCAttributeSetter.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2012 d"
},
{
"path": "KeyValueObjectMapping/DCCustomInitialize.h",
"chars": 705,
"preview": "//\n// DCCustomInitialize.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 8/21/12.\n// Copyright (c) 2012 "
},
{
"path": "KeyValueObjectMapping/DCCustomInitialize.m",
"chars": 788,
"preview": "//\n// DCCustomInitialize.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 8/21/12.\n// Copyright (c) 2012 "
},
{
"path": "KeyValueObjectMapping/DCCustomParser.h",
"chars": 850,
"preview": "//\n// DCCustomParser.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 9/3/12.\n// Copyright (c) 2012 dchoh"
},
{
"path": "KeyValueObjectMapping/DCCustomParser.m",
"chars": 924,
"preview": "//\n// DCCustomParser.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 9/3/12.\n// Copyright (c) 2012 dchoh"
},
{
"path": "KeyValueObjectMapping/DCDictionaryRearranger.h",
"chars": 406,
"preview": "//\n// DCDictionaryRearranger.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2"
},
{
"path": "KeyValueObjectMapping/DCDictionaryRearranger.m",
"chars": 2258,
"preview": "//\n// DCDictionaryRearranger.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2"
},
{
"path": "KeyValueObjectMapping/DCDynamicAttribute.h",
"chars": 1386,
"preview": "//\n// DCDynamicAttribute.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMapping/DCDynamicAttribute.m",
"chars": 3447,
"preview": "//\n// DCDynamicAttribute.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMapping/DCGenericConverter.h",
"chars": 607,
"preview": "//\n// DCGenericConverter.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMapping/DCGenericConverter.m",
"chars": 4717,
"preview": "//\n// DCGenericConverter.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMapping/DCKeyValueObjectMapping.h",
"chars": 1102,
"preview": "//\n// DCKeyValueObjectMapping.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c"
},
{
"path": "KeyValueObjectMapping/DCKeyValueObjectMapping.m",
"chars": 6567,
"preview": "//\n// DCKeyValueObjectMapping.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c"
},
{
"path": "KeyValueObjectMapping/DCMapping.h",
"chars": 289,
"preview": "//\n// DCMapping.h\n// KeyValueObjectMapping\n//\n// Created by moda on 5/19/15.\n// Copyright (c) 2015 dchohfi. All righ"
},
{
"path": "KeyValueObjectMapping/DCNSArrayConverter.h",
"chars": 379,
"preview": "//\n// DCNSArrayConverter.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMapping/DCNSArrayConverter.m",
"chars": 3090,
"preview": "//\n// DCNSArrayConverter.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMapping/DCNSDateConverter.h",
"chars": 352,
"preview": "//\n// DCNSDateConverter.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012"
},
{
"path": "KeyValueObjectMapping/DCNSDateConverter.m",
"chars": 1782,
"preview": "//\n// DCNSDateConverter.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012"
},
{
"path": "KeyValueObjectMapping/DCNSSetConverter.h",
"chars": 405,
"preview": "//\n// DCNSSetConverter.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 6/13/12.\n// Copyright (c) 2012 dc"
},
{
"path": "KeyValueObjectMapping/DCNSSetConverter.m",
"chars": 1603,
"preview": "//\n// DCNSSetConverter.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 6/13/12.\n// Copyright (c) 2012 dc"
},
{
"path": "KeyValueObjectMapping/DCNSURLConverter.h",
"chars": 317,
"preview": "//\n// DCNSURLConverter.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012 "
},
{
"path": "KeyValueObjectMapping/DCNSURLConverter.m",
"chars": 895,
"preview": "//\n// DCNSURLConverter.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012 "
},
{
"path": "KeyValueObjectMapping/DCObjectMapping.h",
"chars": 1068,
"preview": "//\n// DCObjectMapping.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/16/12.\n// Copyright (c) 2012 d"
},
{
"path": "KeyValueObjectMapping/DCObjectMapping.m",
"chars": 2079,
"preview": "//\n// DCObjectMapping.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/16/12.\n// Copyright (c) 2012 d"
},
{
"path": "KeyValueObjectMapping/DCParserConfiguration.h",
"chars": 1548,
"preview": "//\n// DCParserConfiguration.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) "
},
{
"path": "KeyValueObjectMapping/DCParserConfiguration.m",
"chars": 4439,
"preview": "//\n// DCParserConfiguration.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) "
},
{
"path": "KeyValueObjectMapping/DCPropertyAggregator.h",
"chars": 525,
"preview": "//\n// DCPropertyAggregator.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMapping/DCPropertyAggregator.m",
"chars": 1168,
"preview": "//\n// DCPropertyAggregator.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMapping/DCPropertyFinder.h",
"chars": 556,
"preview": "//\n// DCPropertyFinder.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/17/12.\n// Copyright (c) 2012 "
},
{
"path": "KeyValueObjectMapping/DCPropertyFinder.m",
"chars": 3055,
"preview": "//\n// DCPropertyFinder.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/17/12.\n// Copyright (c) 2012 "
},
{
"path": "KeyValueObjectMapping/DCReferenceKeyParser.h",
"chars": 422,
"preview": "//\n// DCReferenceKeyParser.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright (c) 2"
},
{
"path": "KeyValueObjectMapping/DCReferenceKeyParser.m",
"chars": 1333,
"preview": "//\n// DCReferenceKeyParser.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright (c) 2"
},
{
"path": "KeyValueObjectMapping/DCSimpleConverter.h",
"chars": 280,
"preview": "//\n// DCSimpleConverter.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012"
},
{
"path": "KeyValueObjectMapping/DCSimpleConverter.m",
"chars": 595,
"preview": "//\n// DCSimpleConverter.m\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012"
},
{
"path": "KeyValueObjectMapping/DCValueConverter.h",
"chars": 574,
"preview": "//\n// DCValueConverter.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012 "
},
{
"path": "KeyValueObjectMapping/KeyValueObjectMapping-Info.plist",
"chars": 854,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "KeyValueObjectMapping/KeyValueObjectMapping-Prefix.pch",
"chars": 183,
"preview": "//\n// Prefix header for all source files of the 'KeyValueObjectMapping' target in the 'KeyValueObjectMapping' project\n//"
},
{
"path": "KeyValueObjectMapping/NSObject+DCKeyValueObjectMapping.h",
"chars": 792,
"preview": "//\n// NSObject+DCKeyValueObjectMapping.h\n// KeyValueObjectMapping\n//\n// Created by Benjamin Petit on 06/12/2013.\n// "
},
{
"path": "KeyValueObjectMapping/NSObject+DCKeyValueObjectMapping.m",
"chars": 1752,
"preview": "//\n// NSObject+DCKeyValueObjectMapping.m\n// KeyValueObjectMapping\n//\n// Created by Benjamin Petit on 06/12/2013.\n// "
},
{
"path": "KeyValueObjectMapping.xcodeproj/project.pbxproj",
"chars": 63477,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "KeyValueObjectMapping.xcodeproj/xcshareddata/xcschemes/KeyValueObjectMapping.xcscheme",
"chars": 2546,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n LastUpgradeVersion = \"0500\"\n version = \"1.3\">\n <BuildAction\n "
},
{
"path": "KeyValueObjectMapping.xcodeproj/xcshareddata/xcschemes/KeyValueObjectMappingTests.xcscheme",
"chars": 1867,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n LastUpgradeVersion = \"0500\"\n version = \"1.3\">\n <BuildAction\n "
},
{
"path": "KeyValueObjectMappingTests/Bus.h",
"chars": 399,
"preview": "//\n// Bus.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2012 dchohfi. All ri"
},
{
"path": "KeyValueObjectMappingTests/Bus.m",
"chars": 404,
"preview": "//\n// Bus.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2012 dchohfi. All ri"
},
{
"path": "KeyValueObjectMappingTests/DCArrayOfTweetsOnUserTests.h",
"chars": 268,
"preview": "//\n// DCArrayOfTweetsOnUserTests.h\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/16/12.\n// Copy"
},
{
"path": "KeyValueObjectMappingTests/DCArrayOfTweetsOnUserTests.m",
"chars": 3987,
"preview": "//\n// DCArrayOfTweetsOnUserTests.m\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/16/12.\n// Copy"
},
{
"path": "KeyValueObjectMappingTests/DCCoverageFix.h",
"chars": 459,
"preview": "//\n// DCCoverageFix.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2012 dchoh"
},
{
"path": "KeyValueObjectMappingTests/DCCoverageFix.m",
"chars": 444,
"preview": "//\n// DCCoverageFix.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2012 dchoh"
},
{
"path": "KeyValueObjectMappingTests/DCCustomFormaterTests.h",
"chars": 250,
"preview": "//\n// DCCustomFormaterTests.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 9/3/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMappingTests/DCCustomFormaterTests.m",
"chars": 235,
"preview": "//\n// DCCustomFormaterTests.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 9/3/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMappingTests/DCCustomInitializeTest.h",
"chars": 253,
"preview": "//\n// DCCustomInitializeTest.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 8/21/12.\n// Copyright (c) 2"
},
{
"path": "KeyValueObjectMappingTests/DCCustomInitializeTest.m",
"chars": 2463,
"preview": "//\n// DCCustomInitializeTest.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 8/21/12.\n// Copyright (c) 2"
},
{
"path": "KeyValueObjectMappingTests/DCCustomParserTests.h",
"chars": 246,
"preview": "//\n// DCCustomParserTests.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 9/3/12.\n// Copyright (c) 2012 "
},
{
"path": "KeyValueObjectMappingTests/DCCustomParserTests.m",
"chars": 1217,
"preview": "//\n// DCCustomParserTests.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 9/3/12.\n// Copyright (c) 2012 "
},
{
"path": "KeyValueObjectMappingTests/DCDynamicAttributeTest.h",
"chars": 254,
"preview": "//\n// DynamicAttributeTest.h\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright "
},
{
"path": "KeyValueObjectMappingTests/DCDynamicAttributeTest.m",
"chars": 4523,
"preview": "//\n// DynamicAttributeTest.m\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright "
},
{
"path": "KeyValueObjectMappingTests/DCNSDateConverterTests.h",
"chars": 254,
"preview": "//\n// DCNSDateConverterTests.h\n// KeyValueObjectMapping\n//\n// Created by Cristian Bica on 8/25/12.\n// Copyright (c) "
},
{
"path": "KeyValueObjectMappingTests/DCNSDateConverterTests.m",
"chars": 1129,
"preview": "//\n// DCNSDateConverterTests.m\n// KeyValueObjectMapping\n//\n// Created by Cristian Bica on 8/25/12.\n// Copyright (c) "
},
{
"path": "KeyValueObjectMappingTests/DCParserConfigurationTest.h",
"chars": 259,
"preview": "//\n// DCParserConfigurationTest.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 8/21/12.\n// Copyright (c"
},
{
"path": "KeyValueObjectMappingTests/DCParserConfigurationTest.m",
"chars": 2078,
"preview": "//\n// DCParserConfigurationTest.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 8/21/12.\n// Copyright (c"
},
{
"path": "KeyValueObjectMappingTests/DCPropertyAggregatorTests.h",
"chars": 259,
"preview": "//\n// DCPropertyAggregatorTests.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c"
},
{
"path": "KeyValueObjectMappingTests/DCPropertyAggregatorTests.m",
"chars": 3676,
"preview": "//\n// DCPropertyAggregatorTests.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c"
},
{
"path": "KeyValueObjectMappingTests/DCPropertyFinderTests.h",
"chars": 258,
"preview": "//\n// DCPropertyFinderTests.h\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/17/12.\n// Copyright"
},
{
"path": "KeyValueObjectMappingTests/DCPropertyFinderTests.m",
"chars": 2399,
"preview": "//\n// DCPropertyFinderTests.m\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/17/12.\n// Copyright"
},
{
"path": "KeyValueObjectMappingTests/DCReferenceKeyParserTests.h",
"chars": 266,
"preview": "//\n// DCReferenceKeyParserTests.h\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/17/12.\n// Copyr"
},
{
"path": "KeyValueObjectMappingTests/DCReferenceKeyParserTests.m",
"chars": 2267,
"preview": "//\n// DCReferenceKeyParserTests.m\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/17/12.\n// Copyr"
},
{
"path": "KeyValueObjectMappingTests/DCSerializationTests.h",
"chars": 249,
"preview": "//\n// DCSerializationTests.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 6/13/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMappingTests/DCSerializationTests.m",
"chars": 2982,
"preview": "//\n// DCSerializationTests.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 6/13/12.\n// Copyright (c) 201"
},
{
"path": "KeyValueObjectMappingTests/KeyValueObjectMappingTests-Info.plist",
"chars": 694,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "KeyValueObjectMappingTests/KeyValueObjectMappingTests.h",
"chars": 267,
"preview": "//\n// DCKeyValueObjectMappingTests.h\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/13/12.\n// Co"
},
{
"path": "KeyValueObjectMappingTests/KeyValueObjectMappingTests.m",
"chars": 16589,
"preview": "//\n// DCKeyValueObjectMappingTests.m\n// DCKeyValueObjectMappingTests\n//\n// Created by Diego Chohfi on 4/13/12.\n// Co"
},
{
"path": "KeyValueObjectMappingTests/Location.h",
"chars": 404,
"preview": "//\n// Location.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2012 dchohfi. A"
},
{
"path": "KeyValueObjectMappingTests/Location.m",
"chars": 449,
"preview": "//\n// Location.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/18/12.\n// Copyright (c) 2012 dchohfi. A"
},
{
"path": "KeyValueObjectMappingTests/NSObject+DCKeyValueObjectMappingTests.m",
"chars": 16274,
"preview": "//\n// NSObject+DCKeyValueObjectMappingTests.m\n// KeyValueObjectMapping\n//\n// Created by Benjamin Petit on 06/12/2013."
},
{
"path": "KeyValueObjectMappingTests/Person.h",
"chars": 696,
"preview": "//\n// Person.h\n// JSONParser\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012 None. All rights reserv"
},
{
"path": "KeyValueObjectMappingTests/Person.m",
"chars": 283,
"preview": "//\n// Person.m\n// JSONParser\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012 None. All rights reserv"
},
{
"path": "KeyValueObjectMappingTests/Tweet.h",
"chars": 932,
"preview": "//\n// Tweet.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright (c) 2012 None. All rig"
},
{
"path": "KeyValueObjectMappingTests/Tweet.m",
"chars": 528,
"preview": "//\n// Tweet.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright (c) 2012 None. All rig"
},
{
"path": "KeyValueObjectMappingTests/User.h",
"chars": 900,
"preview": "//\n// User.h\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright (c) 2012 None. All righ"
},
{
"path": "KeyValueObjectMappingTests/User.m",
"chars": 503,
"preview": "//\n// User.m\n// KeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/14/12.\n// Copyright (c) 2012 None. All righ"
},
{
"path": "KeyValueObjectMappingTests/en.lproj/InfoPlist.strings",
"chars": 45,
"preview": "/* Localized versions of Info.plist keys */\n\n"
},
{
"path": "KeyValueObjectMappingTests/plist.plist",
"chars": 893,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "KeyValueObjectMappingTests/tweet.json",
"chars": 2536,
"preview": "{\n \"created_at\": \"Sat Apr 14 00:20:07 +0000 2012\",\n \"id\": 190957570511478784,\n \"id_str\": \"190957570511478784\",\n"
},
{
"path": "KeyValueObjectMappingTests/user.json",
"chars": 776,
"preview": "{\n \"id_str\": \"27924446\",\n \"name\": \"Diego Chohfi\",\n \"screen_name\": \"dchohfi\",\n \"location\": \"São Paulo\",\n \""
},
{
"path": "LICENSE",
"chars": 1083,
"preview": "Copyright (C) 2012 Diego Chohfi Turini (http://dchohfi.com)\n\nPermission is hereby granted, free of charge, to any person"
},
{
"path": "README.md",
"chars": 13755,
"preview": "Introduction\n=========================\n\n**KeyValueObjectMapping** is a Cocoa framework that provides an easy way to deal"
}
]
About this extraction
This page contains the full source code of the dchohfi/KeyValueObjectMapping GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 91 files (210.4 KB), approximately 58.5k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.