Blake Watters
54007c78d4
Reworked Brendan Ribera's contributions around time zone handling to eliminate the use of transient
...
NSDateFormatters, added a preferredDateFormatter for use when serializing dates to strings,
replaced the use of the description method for date encoding to strings with invocation of the
preferredDateFormatter, added new attribute transformation strategy from NSDate -> NSString properties
(also using the preferred date formatter), and provided customization support for date handling globally
and on a per-mapping basis. closes #200 , closes #313 , closes #309 , closes #308
2011-09-05 17:25:43 -04:00
Jeff Arena
aceb75200a
Fix for issues setting many-to-many relationships on NSManagedObjects, as well as some additional test coverage for the issue. fixes #271
2011-08-27 21:00:19 -04:00
Blake Watters
07830b5d87
Merge branch 'numbers-can-map-to-strings' of https://github.com/crayment/RestKit into crayment-numbers-can-map-to-strings
...
Conflicts:
Code/ObjectMapping/RKObjectMappingOperation.m
Specs/ObjectMapping/RKObjectMappingOperationSpec.m
2011-08-27 19:32:35 -04:00
Nolan Waite
8520d3e28b
Transform numbers to decimal numbers.
2011-08-25 23:15:07 -04:00
Blake Watters
1f66ce7e46
Added support for mapping a single object into a destination collections. fixes #310
2011-08-25 22:21:54 -04:00
Blake Watters
2e430644d9
Added support for using NSEntityDescription to lookup property types for NSManagedObject attribute and relationships. This enables mapping type transformations on mappings defined against Core Data entities instead of concrete subclasses. fixes #233
2011-08-14 23:21:51 -04:00
Blake Watters
47c78b181c
Adding trace mapping for RKObjectMappingOperation
2011-08-14 21:25:13 -04:00
Cody Rayment
46fc65efb3
Allow numbers to map to strings
2011-08-10 00:08:31 -06:00
Blake Watters
4e03ba7bef
Renamed Polymorphic mapping to dynamic mapping after consulting with the community. Dropped abstract superclass in favor of a RKObjectMappingDefinition protocol. Caught missing cases with dynamic object mapping + targetObject. Updated docs and method signatures to reflect the updates.
2011-07-31 19:37:42 -04:00
Blake Watters
670234b775
Added support for polymorphic object mapping (Github #105 , #244 ). This enables you to dynamically map objects to different destination classes or using different mapping strategies via configuration or callbacks. See Docs/Object Mapping.md for details.
...
Other changes include:
* Eliminated the RKObjectFactory protocol and implementations. Object mapping instances themselves are
now responsible for instantiating target objects for mapping.
* Introduced RKObjectAbstractMapping superclass for RKObjectMapping and RKObjectPolymorphicMapping.
* Updated example applications to use block object loaders (RKTwitter and RKTwitterCoreData)
* Refactored method signatures of RKObjectMapper, RKObjectMapping, and RKObjectMappingProvider to reflect the
existence of abstract mapping types. This was necessary to make polymorphic mappings integrate cleanly.
* Fixed overlap in RestKit error domains between network and object mapping. fixes #208
2011-07-30 16:00:36 -04:00
Blake Watters
bd29ee038b
Added non-underscored class name for NSCFBoolean matches in transformation from Boolean to String
2011-07-27 08:00:15 -04:00
Blake Watters
570b13ca07
Updated Object Mapping documentation, added support for inferring object mappings based off of the type of the object used in postObject:, putObject:, etc. Made KVC validation optional.
2011-07-23 23:47:03 -04:00
Blake Watters
73fb461a8b
Reworked object mapping behaviors to better accommodate situations where the server side responds with a successful status code and a payload that does not contain any mappable attributes or relationships. We now consider this to be successful. If a mapping operation is performed that does not result in any mappings being applied, it will return NO without setting an error. If an instance of RKObjectMapper is invoked that does not find any mappable content in the payload, this will result in an unmappable content error. The object loader guards against this by not attempting to map any empty payloads. This should ensure that you only get the unmappable content error if you have asked RK to load and map a payload it cannot find an object mapping for.
2011-07-07 09:53:46 -04:00
Duncan Lewis
403bf29f57
Added helper functions to RKObjectSerializer to map local objects into json
2011-06-30 12:28:28 -04:00
Blake Watters
6faa525344
Added specs and support for either failing out the mapping operation or skipping over an attribute depending on key/value validation response. If NO is returned and a validation error is returned, the mapping operation will fail. If NO is returned without an error, the attribute will be skipped and a warning will be logged. You can also mutate the values. closes #166
2011-06-29 15:07:43 -04:00
Scott Penrose
41071ad61a
Added Key-Value validation checking during object mapping operation. If you return NO it will continue mapping but skip that key path. If you set the error it will error out of object mapping operation. Issue #166
2011-06-29 14:11:00 -04:00
Blake Watters
3dfbaf1810
Updated to support setting default value instead of nil when an attribute is missing in the payload. For Core Data backed models, we consult the entity definition to obtain the default value. closes #117
2011-06-28 15:22:04 -04:00
Blake Watters
0954d4a063
Fixing more memory leaks
2011-06-20 15:03:35 -04:00
Blake Watters
3bf4b7bc0f
Implemented nested mapping for structures similar to the BuildBot JSON structure. fixes #112
2011-06-17 15:36:28 -04:00
Jeremy Ellison
ae68829ec4
transform booleans to strings
2011-06-16 19:30:10 -04:00
Blake Watters
323d5e30b1
Add support for mapping from NSNumber to NSDate by coercing to a time interval since 1970. fixes #141
2011-06-16 17:33:21 -04:00
Blake Watters
420d20384f
Add support for mapping yes and no to NSNumber boolean values
2011-06-15 09:59:45 -04:00
Blake Watters
27ea307816
Fix crash in RKCatalog. Suppress warning about symbol visibility during linking.
2011-06-11 20:27:33 -04:00
Blake Watters
9299cabc11
Implemented flexible logging solution utilizing the excellent LibComponentLogging library.
2011-06-11 20:25:28 -04:00
Blake Watters
7bf3e0f273
Added support for mapping boolean strings to NSNumber with values t or f in addition to true and false. refs #130
2011-06-11 19:31:21 -04:00
Blake Watters
f3c0995d5e
Implementation of Object Mapping 2.0 design:
...
* Removed RestKit from inheritance hierarchy
* Mappings are implemented as concrete classes
* Mapper is much more flexible & powerful
* Much more robust error handling
* Serialization is reimplemented as an object mapping operation
* Added ability to serialize to JSON natively
* Reworked Core Data integration
* Simplified the codebase substantially
2011-06-11 19:26:56 -04:00