|
@@ -382,32 +382,33 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
+ (nullable NSArray<NSString *> *)modelPropertyWhitelist;
|
|
|
|
|
|
/**
|
|
|
- If the default json-to-model transform does not fit to your model object, implement
|
|
|
- this method to do additional process. You can also use this method to validate the
|
|
|
- model's properties.
|
|
|
+ This method's behavior is similar to `- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic;`,
|
|
|
+ but be called before the model transform.
|
|
|
|
|
|
- @discussion If the model implements this method, it will be called at the end of
|
|
|
+ @discussion If the model implements this method, it will be called before
|
|
|
`+modelWithJSON:`, `+modelWithDictionary:`, `-modelSetWithJSON:` and `-modelSetWithDictionary:`.
|
|
|
- If this method returns NO, the transform process will ignore this model.
|
|
|
+ If this method returns nil, the transform process will ignore this model.
|
|
|
|
|
|
@param dic The json/kv dictionary.
|
|
|
|
|
|
- @return Returns YES if the model is valid, or NO to ignore this model.
|
|
|
+ @return Returns the modified dictionary, or nil to ignore this model.
|
|
|
*/
|
|
|
-- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic;
|
|
|
+- (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic;
|
|
|
|
|
|
/**
|
|
|
- This method's behavior is similar to `- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic;`, but be called before the model transform.
|
|
|
+ If the default json-to-model transform does not fit to your model object, implement
|
|
|
+ this method to do additional process. You can also use this method to validate the
|
|
|
+ model's properties.
|
|
|
|
|
|
- @discussion If the model implements this method, it will be called before
|
|
|
+ @discussion If the model implements this method, it will be called at the end of
|
|
|
`+modelWithJSON:`, `+modelWithDictionary:`, `-modelSetWithJSON:` and `-modelSetWithDictionary:`.
|
|
|
- If this method returns nil, the transform process will ignore this model.
|
|
|
+ If this method returns NO, the transform process will ignore this model.
|
|
|
|
|
|
@param dic The json/kv dictionary.
|
|
|
|
|
|
- @return Returns NSDictionary for change the json/kv dictionary, or nil to ignore this model.
|
|
|
+ @return Returns YES if the model is valid, or NO to ignore this model.
|
|
|
*/
|
|
|
-- (NSDictionary *)modelCustomWillTransformFromDictionary:(NSDictionary *)dic;
|
|
|
+- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic;
|
|
|
|
|
|
/**
|
|
|
If the default model-to-json transform does not fit to your model class, implement
|