Added convenience methods and docs for mapping NSSet and NSArray attribute collections. fixes #285

This commit is contained in:
Blake Watters
2011-09-19 21:03:02 -04:00
parent 4b287a5b24
commit 91a6e9423e
2 changed files with 43 additions and 3 deletions

View File

@@ -264,7 +264,39 @@ relationship. Relationships are processed using an object mapping as well.
@param attributeKey A key-value coding key corresponding to a value in the mappable source object and an attribute
on the destination class that have the same name.
*/
- (void)mapAttributes:(NSString*)attributeKey, ... NS_REQUIRES_NIL_TERMINATION;
- (void)mapAttributes:(NSString *)attributeKey, ... NS_REQUIRES_NIL_TERMINATION;
/**
Defines an attribute mapping for each string attribute in the collection where the source keyPath and the
destination attribute property have the same name.
For example, given the transformation from a JSON dictionary:
{"name": "My Name", "age": 28}
To a Person class with corresponding name & age properties, we could configure the attribute mappings via:
[mapping mapAttributesFromSet:[NSSet setWithObjects:@"name", @"age", nil]];
@param set A set of string attribute keyPaths to deifne mappings for
*/
- (void)mapAttributesFromSet:(NSSet *)set;
/**
Defines an attribute mapping for each string attribute in the collection where the source keyPath and the
destination attribute property have the same name.
For example, given the transformation from a JSON dictionary:
{"name": "My Name", "age": 28}
To a Person class with corresponding name & age properties, we could configure the attribute mappings via:
[mapping mapAttributesFromSet:[NSArray arrayWithObjects:@"name", @"age", nil]];
@param array An array of string attribute keyPaths to deifne mappings for
*/
- (void)mapAttributesFromArray:(NSArray *)set;
/**
Defines a relationship mapping for a key where the source keyPath and the destination relationship property