TRCObjectMapper
creates model objects from response data and creates response data from model objects.
More...
Instance Methods | |
(NSString *) | - responseValidationSchemaName |
Specify name of schema file here, to validate response object. More... | |
(id) | - objectFromResponseObject:error: |
Creates model object and map values from responseObject into that object. More... | |
(NSString *) | - requestValidationSchemaName |
Specify name of schema file here, to validate request object. More... | |
(id) | - requestObjectFromObject:error: |
Creates request object, acceptable by request serialization, using object . More... | |
TRCObjectMapper
creates model objects from response data and creates response data from model objects.
It's called mapper
because response data already converted using child TRCObjectMappers
and TRCValueTransfers
, so you'll just map data into your model object here, without any conversion and checking.
Use TRCObjectMapper
to reuse mapping code you may have in TRCRequest.responseProcessedFromBody:headers:status:error:
, then each your model object will have own TRCObjectMapper
.
Each TRCObjectMapper
can have schemes just like TRCRequest
, to validate and post-process request and response objects.
|
optional |
Specify name of schema file here, to validate response object.
if this method isn't implemented, ClassName.response.{format} or ClassName.{format} will be used
|
optional |
Creates model object and map values from responseObject
into that object.
If your TRCObjectMapper
has scheme for response object, then responseObject
already validated and post-processed by child mappers and TRCValueTransformers
.
To see more information kind of responseObject
, see TRCRequest.responseProcessedFromBody:headers:status:error:
You are free to return nil
in that method. That object would be skipped. You also can write into error
pointer in case of error. Then request will be finished with that error
nil
TRCRequest.responseProcessedFromBody:headers:status:error:
|
optional |
Specify name of schema file here, to validate request object.
if this method isn't implemented, ClassName.request.{format} or ClassName.{format} will be used
|
optional |
Creates request object, acceptable by request serialization, using object
.
Returned object would be transformed using child TRCObjectMappers
and TRCValueTransformer
s if specified in schema, and then validated
See TRCRequest.requestBody
for details, because same rules applies to returned object.