This repository was archived by the owner on Jul 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeModel.h
More file actions
73 lines (60 loc) · 1.54 KB
/
NodeModel.h
File metadata and controls
73 lines (60 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
// NodeModel.h
// NodeModel
//
// Created by YouXianMing on 15/11/10.
// Copyright © 2015年 ZiPeiYi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PropertyInfomation.h"
static NSString *stringType = @"NSString";
static NSString *numberType = @"NSNumber";
static NSString *nullType = @"NSNull";
@interface NodeModel : NSObject
/**
* 列表名字
*/
@property (nonatomic, strong) NSString *listType;
/**
* model的名字(在listType的基础上追加了Model字符串)
*/
@property (nonatomic, strong) NSString *modelName;
/**
* 当前树形结构级别
*/
@property (nonatomic) NSInteger level;
/**
* 普通的属性
*/
@property (nonatomic, strong) NSMutableDictionary *normalProperties;
/**
* 字典类型元素
*/
@property (nonatomic, strong) NSMutableDictionary <NSString *, NodeModel *> *dictionaryTypeModelList;
/**
* 数组类型元素
*/
@property (nonatomic, strong) NSMutableDictionary <NSString *, NodeModel *> *arrayTypeModelList;
/**
* 便利构造器
*
* @param dictionary 数据字典
* @param name model名字
* @param level 当前树形结构级别
*
* @return NodeModel对象
*/
+ (instancetype)nodeModelWithDictionary:(NSDictionary *)dictionary
modelName:(NSString *)name
level:(NSInteger)level;
/**
* 所有的property
*/
@property (nonatomic, strong, readonly) NSMutableArray <PropertyInfomation *> *properties;
/**
* 所有子孙节点
*
* @return 数组
*/
- (NSArray *)allSubNodes;
@end