BBAJSONPredicate.h
1.18 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
//
// BBAJSONPredicate.h
// BBAPods
//
// Created by Xiong Feng on 15/8/6.
//
//
#import <Foundation/Foundation.h>
@interface BBAJSONPredicate : NSObject
+ (instancetype)predicateWithRules:(NSObject *)rules;
- (instancetype)initWithRules:(NSObject *)rules;
- (BOOL)validateJSON:(__kindof NSObject *)anObject;
@property (nonatomic) BOOL isOptional;
@end
@interface BBAJSONPredicateKeyValue : BBAJSONPredicate
@property (nonatomic, strong) NSString *key;
@property (nonatomic, strong) NSArray *keys;
@property (nonatomic) NSInteger index;
@property (nonatomic, strong) BBAJSONPredicate *predicate;
- (instancetype)initWithKey:(NSObject *)key rules:(NSObject *)rules;
- (BOOL)validateDictionary:(NSDictionary *)aDictionary;
- (BOOL)validateArray:(NSArray *)anArray;
@end
@interface BBAJSONPredicateDictionary : BBAJSONPredicate
@property (nonatomic, strong) NSArray *predicates;
@end
@interface BBAJSONPredicateArray : BBAJSONPredicate
@property (nonatomic, strong) NSArray *predicates;
@end
@interface BBAJsonSimplePredicate : BBAJSONPredicate
@property (nonatomic) char option;
@end
@interface BBAJsonValuePredicate : BBAJSONPredicate
@property (nonatomic, strong) NSArray *values;
@end