美文网首页
Model & JSON is back

Model & JSON is back

作者: 钱嘘嘘 | 来源:发表于2018-02-27 16:21 被阅读25次

YYModel

YYModel_sequence YYModel

YYClassInfo

<<< all base on runtime method
YYClassIvarInfo - encap Ivar
-initWithIvar
YYClassMethodInfo - encap Method
-initWithMethod
YYClassPropertyInfo - encap objc_property_t(Type encoding)
-initWithProperty
YYClassInfo - encap Ivar、Method、property by class
+classInfoWithClass

NSObject+YYModel

All convenient inline method for Foundation class c number number value date NSDateFormatter multi key-value


Both for custom like AOP method, ex: +modelCustomPropertyMapper & +modelContainerPropertyGenericClass

_YYModelPropertyMeta - YYClassPropertyInfo wrapper
-metaWithClassInfo

_YYModelMeta - YYClassInfo wrapper
+metaWithClass - cache + dispatch_semaphore


\c - inline ModelCreateNumberFromProperty
\c - inline ModelSetNumberToProperty

————————

\c - ModelSetValueForProperty

\c - ModelSetWithDictionaryFunction
\c - ModelSetWithPropertyMetaArrayFunction

\c - ModelToJSONObjectRecursive
\c - ModelDescriptionAddIndent
\c - ModelDescription


NSObject (YYModel)

+modelWithJSON
+modelWithDictionary - _YYModelMeta
-modelSetWithJSON
-modelSetWithDictionary - ModelSetContext(_YYModelMeta/self/dic) -> CFArrayApplyFunction

-modelToJSONObject
-modelToJSONData
-modelToJSONString

NSArray (YYModel)
+modelArrayWithClass:(json:/array:)

NSDictionary (YYModel)
+modelDictionaryWithClass:(json:/dictionary:)

YYModel <NSObject> - for protocol convert

MJExtension

MJExtension_sequence MJExtension

MJExtensionConst - const type coding str
MJFoundation - isClassFromFoundation

MJProperty

  • cachedPropertyWithProperty: (_name+MJPropertyType)
    + 多级映射 key, like [[MJPropertyKey]], [[[MJPropertyKey], [MJPropertyKey]]]
    + (AssociatedObject cache)

MJPropertyKey
-name
-valueInObject:(NSMutableDictionary cache)

MJPropertyType
+cachedTypeWithCode

NSObject (MJClass) - white/black list cache

+mj_enumerateClasses - callback classBlock exclusive FoundationClass
+mj_enumerateAllClasses - callback classBlock

+mj_setupBlockReturnValue - AssociatedObj cache block return
+mj_setupAllowedPropertyNames
+mj_setupIgnoredPropertyNames
+mj_setupAllowedCodingPropertyNames
+mj_setupIgnoredCodingPropertyNames

+mj_totalObjectsWithSelector - get cache arr by SEL return - performSelector return
+mj_totalAllowedPropertyNames
+mj_totalIgnoredPropertyNames
+mj_totalAllowedCodingPropertyNames
+mj_totalIgnoredCodingPropertyNames

NSObject (MJProperty)

+mj_enumerateProperties - callback block
+properties - cachedProperties(MJProperty)
+propertyKey - AOP method & block return
+propertyObjectClassInArray - AOP method & block return

+mj_setupNewValueFromOldValue - AssociatedObj cache
+mj_getNewValueFromObject - AOP or cacheBlock return

// AssociatedObj cache
+mj_setupReplacedKeyFromPropertyName
+mj_setupReplacedKeyFromPropertyName121
+mj_setupObjectClassInArray

NSObject+MJKeyValue

MJKeyValue <NSObject>
-all AOP method

NSObject (MJKeyValue) <MJKeyValue>

Dict->model
-mj_setKeyValues - mj_enumerateProperties(custom class&DictArr&pro)
+mj_objectWithKeyValues - instantiate
+mj_objectArrayWithKeyValuesArray - 拆分-mj_objectWithKeyValues

Model->Dict
-mj_keyValuesWithKeys - mj_enumerateProperties(custom class&DictArr&pro)
+mj_keyValuesArrayWithObjectArray - 拆分-mj_keyValuesWithKeys

-mj_JSONObject

相关文章

网友评论

      本文标题:Model & JSON is back

      本文链接:https://www.haomeiwen.com/subject/xkjmxftx.html